Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 217549
b: refs/heads/master
c: b903c0b
h: refs/heads/master
i:
  217547: 50b4b17
v: v3
  • Loading branch information
Changli Gao authored and Linus Torvalds committed Oct 26, 2010
1 parent e9d4d55 commit b5f29c8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5e0579812834ab7fa072db4a15ebdff68d62e2e7
refs/heads/master: b903c0b8899b46829a9b80ba55b61079b35940ec
8 changes: 6 additions & 2 deletions trunk/lib/vsprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1504,7 +1504,7 @@ EXPORT_SYMBOL(snprintf);
* @...: Arguments for the format string
*
* The return value is the number of characters written into @buf not including
* the trailing '\0'. If @size is <= 0 the function returns 0.
* the trailing '\0'. If @size is == 0 the function returns 0.
*/

int scnprintf(char *buf, size_t size, const char *fmt, ...)
Expand All @@ -1516,7 +1516,11 @@ int scnprintf(char *buf, size_t size, const char *fmt, ...)
i = vsnprintf(buf, size, fmt, args);
va_end(args);

return (i >= size) ? (size - 1) : i;
if (likely(i < size))
return i;
if (size != 0)
return size - 1;
return 0;
}
EXPORT_SYMBOL(scnprintf);

Expand Down

0 comments on commit b5f29c8

Please sign in to comment.