diff options
author | fvogel <fvogelnew1@free.fr> | 2023-01-12 00:04:55 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2023-01-12 00:04:55 (GMT) |
commit | 91c03f8f7b13c7f0c997749c6808cd01db9807a3 (patch) | |
tree | f9ffd1e4bcab63d71c9d4ba131d867cbeca55db2 /generic/tkUtil.c | |
parent | 12c0146aaec25379a108581c8582dd79eedcc066 (diff) | |
download | tk-91c03f8f7b13c7f0c997749c6808cd01db9807a3.zip tk-91c03f8f7b13c7f0c997749c6808cd01db9807a3.tar.gz tk-91c03f8f7b13c7f0c997749c6808cd01db9807a3.tar.bz2 |
Provide explicit size in snprintf when needed. Fix gcc warning: 'argument to ‘sizeof’ in ‘snprintf’ call is the same expression as the destination; did you mean to provide an explicit length? [-Wsizeof-pointer-memaccess]'
Diffstat (limited to 'generic/tkUtil.c')
-rw-r--r-- | generic/tkUtil.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/generic/tkUtil.c b/generic/tkUtil.c index 63bbc0e..73a323b 100644 --- a/generic/tkUtil.c +++ b/generic/tkUtil.c @@ -431,7 +431,7 @@ TkOffsetPrintProc( return "end"; } p = (char *)ckalloc(32); - snprintf(p, sizeof(p), "%d", offsetPtr->flags & ~TK_OFFSET_INDEX); + snprintf(p, 32, "%d", offsetPtr->flags & ~TK_OFFSET_INDEX); *freeProcPtr = TCL_DYNAMIC; return p; } @@ -464,7 +464,7 @@ TkOffsetPrintProc( if (offsetPtr->flags & TK_OFFSET_RELATIVE) { *q++ = '#'; } - snprintf(q, sizeof(q), "%d,%d", offsetPtr->xoffset, offsetPtr->yoffset); + snprintf(q, 32, "%d,%d", offsetPtr->xoffset, offsetPtr->yoffset); *freeProcPtr = TCL_DYNAMIC; return p; } |