diff options
author | Darren Tucker <dtucker@zip.com.au> | 2011-10-01 18:46:12 +1000 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2011-10-01 18:46:12 +1000 |
commit | 036876cd7d53236278fcfbd3a89e4ed9a4d9a214 (patch) | |
tree | b69287763de07a17a183d942890247ed630e5a67 | |
parent | b54f50e5d0053e2c79fbb5032722aca541fdc6c1 (diff) |
- (dtucker) [openbsd-compat/mktemp.c] Fix compiler warning. ok djm
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | openbsd-compat/mktemp.c | 2 |
2 files changed, 4 insertions, 1 deletions
@@ -1,3 +1,6 @@ | |||
1 | 2011101 | ||
2 | - (dtucker) [openbsd-compat/mktemp.c] Fix compiler warning. ok djm | ||
3 | |||
1 | 20110929 | 4 | 20110929 |
2 | - (djm) [configure.ac defines.h] No need to detect sizeof(char); patch | 5 | - (djm) [configure.ac defines.h] No need to detect sizeof(char); patch |
3 | from des AT des.no | 6 | from des AT des.no |
diff --git a/openbsd-compat/mktemp.c b/openbsd-compat/mktemp.c index 773e9eaa5..4eb52f421 100644 --- a/openbsd-compat/mktemp.c +++ b/openbsd-compat/mktemp.c | |||
@@ -54,7 +54,7 @@ mktemp_internal(char *path, int slen, int mode) | |||
54 | int fd; | 54 | int fd; |
55 | 55 | ||
56 | len = strlen(path); | 56 | len = strlen(path); |
57 | if (len == 0 || slen >= len) { | 57 | if (len == 0 || slen < 0 || (size_t)slen >= len) { |
58 | errno = EINVAL; | 58 | errno = EINVAL; |
59 | return(-1); | 59 | return(-1); |
60 | } | 60 | } |