diff options
Diffstat (limited to 'cups/string.c')
-rw-r--r-- | cups/string.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/cups/string.c b/cups/string.c index 39a787f..0d4ed0f 100644 --- a/cups/string.c +++ b/cups/string.c @@ -695,10 +695,11 @@ _cups_strlcat(char *dst, /* O - Destination string */ */ dstlen = strlen(dst); - size -= dstlen + 1; - if (!size) - return (dstlen); /* No room, return immediately... */ + if (size < (dstlen + 1)) + return (dstlen); /* No room, return immediately... */ + + size -= dstlen + 1; /* * Figure out how much room is needed... |