diff options
author | joerg <joerg> | 2008-06-19 17:28:09 +0000 |
---|---|---|
committer | joerg <joerg> | 2008-06-19 17:28:09 +0000 |
commit | 710421d567271668bdbad9b6c9d9a42299832306 (patch) | |
tree | 72061a5bfa16d9f1db3759ccb958d78e054dd848 /pkgtools | |
parent | 465908cbea04a37060ae980cb102c4d0c8659013 (diff) | |
download | pkgsrc-710421d567271668bdbad9b6c9d9a42299832306.tar.gz |
Make style more consistent.
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/libnbcompat/files/snprintf.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/pkgtools/libnbcompat/files/snprintf.c b/pkgtools/libnbcompat/files/snprintf.c index b4e53aeba4b..e395f758f31 100644 --- a/pkgtools/libnbcompat/files/snprintf.c +++ b/pkgtools/libnbcompat/files/snprintf.c @@ -1,4 +1,4 @@ -/* $NetBSD: snprintf.c,v 1.6 2008/02/14 19:14:54 tnn Exp $ */ +/* $NetBSD: snprintf.c,v 1.7 2008/06/19 17:28:09 joerg Exp $ */ /*- * Copyright (c) 2007 Tobias Nygren <tnn@NetBSD.org> @@ -59,9 +59,9 @@ vsnprintf(char *str, size_t size, const char *format, va_list ap) char *p = buf; static FILE *devnull = 0; - if (!devnull) { + if (devnull == NULL) { devnull = fopen("/dev/null", "w"); - if (!devnull) + if (devnull == NULL) return -1; } @@ -70,13 +70,13 @@ vsnprintf(char *str, size_t size, const char *format, va_list ap) return len; if (len > 128) { - p = malloc(len + 1); - if (!p) + p = malloc(len + 1); + if (p == NULL) return -1; } vsprintf(p, format, ap); - + if (size > 0) { memcpy(str, p, MIN(len, size)); str[MIN(len, size - 1)] = 0; |