diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/oid_registry.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/oid_registry.c b/lib/oid_registry.c index 318f382..41b9e50 100644 --- a/lib/oid_registry.c +++ b/lib/oid_registry.c @@ -142,9 +142,9 @@ int sprint_oid(const void *data, size_t datasize, char *buffer, size_t bufsize) } ret += count = snprintf(buffer, bufsize, ".%lu", num); buffer += count; - bufsize -= count; - if (bufsize == 0) + if (bufsize <= count) return -ENOBUFS; + bufsize -= count; } return ret; |