mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 10:50:10 +00:00
14c8a603e3
When using strncpy() with a buffer we need to account for the terminating NUL character. GCC 8 started warning when using PPD_MAX_NAME as the buffer length for strncpy() because the buffer we're copying into has the same length — which means that the terminating NUL may be skipped if the source string has a length of PPD_MAX_NAME. The appropriate way to handle the case where we're copying a source with a length bigger than of PPD_MAX_NAME is, as reported in the strncpy() documentation, to copy `PPD_MAX_NAME - 1` bytes, and explicitly NUL terminate the destination buffer. This has the additional benefit of avoiding the compiler warning. |
||
---|---|---|
.. | ||
gtkcloudprintaccount.c | ||
gtkcloudprintaccount.h | ||
gtkcupssecretsutils.c | ||
gtkcupssecretsutils.h | ||
gtkcupsutils.c | ||
gtkcupsutils.h | ||
gtkprintbackendcloudprint.c | ||
gtkprintbackendcloudprint.h | ||
gtkprintbackendcups.c | ||
gtkprintbackendcups.h | ||
gtkprintbackendfile.c | ||
gtkprintbackendfile.h | ||
gtkprintbackendlpr.c | ||
gtkprintbackendlpr.h | ||
gtkprintercloudprint.c | ||
gtkprintercloudprint.h | ||
gtkprintercups.c | ||
gtkprintercups.h | ||
meson.build |