1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-05 13:18:20 +03:00

cleanup: libdm simplier error comparation

When testing return value from snprintf
use simplier form '>=' instead of  '+1 >'.
This commit is contained in:
Zdenek Kabelac 2014-07-02 00:00:31 +02:00
parent e21d0eb90e
commit 748af97afc

View File

@ -122,7 +122,7 @@ int dm_snprintf(char *buf, size_t bufsize, const char *format, ...)
n = vsnprintf(buf, bufsize, format, ap);
va_end(ap);
if (n < 0 || ((unsigned) n + 1 > bufsize))
if (n < 0 || ((unsigned) n >= bufsize))
return -1;
return n;