diff options
author | Mike Frysinger <vapier@gentoo.org> | 2013-04-22 15:20:17 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2013-04-22 15:20:17 -0400 |
commit | d7a0e79f13cff40bc44e64319887253683a3ede9 (patch) | |
tree | 4191266a4e602bb0c48544dd64118db7797c33a8 /src/gd_xbm.c | |
parent | da63a5af38cce4082d8d4a502aacb6649a06f8b8 (diff) | |
download | libgd-d7a0e79f13cff40bc44e64319887253683a3ede9.tar.gz |
gd_xbm: fix fortify warning
When glibc fortify is enabled, we get this warning:
gd_xbm.c: In function 'gdCtxPrintf':
gd_xbm.c:150:2: warning: passing argument 1 of 'vsnprintf' from incompatible pointer type [enabled by default]
len = vsnprintf(&buf, sizeof(buf)-1, format, args);
^
In file included from /usr/include/stdio.h:937:0,
from gd_xbm.c:5:
/usr/include/bits/stdio2.h:74:42: note: expected 'char * __restrict__' but argument is of type 'char (*)[4096]'
__NTH (vsnprintf (char *__restrict __s, size_t __n,
^
Since &buf and buf are in practice the same pointer with arrays like
this, drop the & to fix the warning.
Diffstat (limited to 'src/gd_xbm.c')
-rw-r--r-- | src/gd_xbm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gd_xbm.c b/src/gd_xbm.c index c6dfae1..a314c99 100644 --- a/src/gd_xbm.c +++ b/src/gd_xbm.c @@ -147,7 +147,7 @@ static void gdCtxPrintf(gdIOCtx * out, const char *format, ...) va_list args; va_start(args, format); - len = vsnprintf(&buf, sizeof(buf)-1, format, args); + len = vsnprintf(buf, sizeof(buf)-1, format, args); va_end(args); out->putBuf(out, buf, len); } |