Changeset 4f4018b in mainline for uspace/lib/c/generic/io/asprintf.c
- Timestamp:
- 2019-02-05T15:25:50Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- cca2d93b
- Parents:
- 472fe7a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/io/asprintf.c
r472fe7a r4f4018b 86 86 va_list args2; 87 87 va_copy(args2, args); 88 int ret = v printf_size(fmt, args2);88 int ret = vsnprintf(NULL, 0, fmt, args2); 89 89 va_end(args2); 90 90 91 91 if (ret > 0) { 92 *strp = malloc( STR_BOUNDS(ret)+ 1);92 *strp = malloc(ret + 1); 93 93 if (*strp == NULL) 94 94 return -1; 95 95 96 vsnprintf(*strp, STR_BOUNDS(ret)+ 1, fmt, args);96 vsnprintf(*strp, ret + 1, fmt, args); 97 97 } 98 98
Note:
See TracChangeset
for help on using the changeset viewer.