X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=cups%2Fstring.c;fp=cups%2Fstring.c;h=0d4ed0f50e4d54dce0f7fe92d2a78b1c5992d727;hb=e38ab40b22a755f2ef48cd537a4782e74acf94a1;hp=39a787f0ec427f459ad21c19865878186f43b88e;hpb=f2e8714723abaa8c0e05abaf2f64e45ad5856598;p=thirdparty%2Fcups.git diff --git a/cups/string.c b/cups/string.c index 39a787f0e..0d4ed0f50 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...