artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9737f5f
)
strncmp is a more reasonable way to check the beginning of a string.
author
tedu
<tedu@openbsd.org>
Thu, 28 Jul 2016 21:40:25 +0000
(21:40 +0000)
committer
tedu
<tedu@openbsd.org>
Thu, 28 Jul 2016 21:40:25 +0000
(21:40 +0000)
usr.bin/mg/fileio.c
patch
|
blob
|
history
diff --git
a/usr.bin/mg/fileio.c
b/usr.bin/mg/fileio.c
index
667ad69
..
1888fd0
100644
(file)
--- a/
usr.bin/mg/fileio.c
+++ b/
usr.bin/mg/fileio.c
@@
-1,4
+1,4
@@
-/* $OpenBSD: fileio.c,v 1.10
2 2016/07/28 21:37:4
5 tedu Exp $ */
+/* $OpenBSD: fileio.c,v 1.10
3 2016/07/28 21:40:2
5 tedu Exp $ */
/* This file is in the public domain. */
@@
-681,13
+681,10
@@
toggleleavetmp(int f, int n)
int
bkupleavetmp(const char *fn)
{
- char *tmp = NULL;
-
if (!leavetmp)
return(FALSE);
- tmp = strstr(fn, "/tmp");
- if (tmp == fn)
+ if (strncmp(fn, "/tmp", 4) == 0)
return (TRUE);
return (FALSE);