version 1.7, 2014/01/29 14:16:54
|
version 1.8.4.1, 2016/05/14 11:31:38
|
Line 12 terms:
|
Line 12 terms:
|
All of the documentation and software included in the ELWIX and AITNET |
All of the documentation and software included in the ELWIX and AITNET |
Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org> |
Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org> |
|
|
Copyright 2004 - 2014 | Copyright 2004 - 2015 |
by Michael Pounov <misho@elwix.org>. All rights reserved. |
by Michael Pounov <misho@elwix.org>. All rights reserved. |
|
|
Redistribution and use in source and binary forms, with or without |
Redistribution and use in source and binary forms, with or without |
Line 794 ait_sprintfVar(ait_val_t * __restrict v, const char *f
|
Line 794 ait_sprintfVar(ait_val_t * __restrict v, const char *f
|
{ |
{ |
int ret = 0; |
int ret = 0; |
va_list lst; |
va_list lst; |
char *str = NULL; | char str[STRSIZ] = { [0 ... STRSIZ - 1] = 0 }; |
|
|
if (!v || !fmt) |
if (!v || !fmt) |
return -1; |
return -1; |
|
|
va_start(lst, fmt); |
va_start(lst, fmt); |
ret = vasprintf(&str, fmt, lst); | ret = vsnprintf(str, sizeof str - 1, fmt, lst); |
va_end(lst); |
va_end(lst); |
|
|
if (str && ret > -1) { | if (ret > -1) { |
AIT_FREE_VAL(v); |
AIT_FREE_VAL(v); |
AIT_SET_STR(v, str); |
AIT_SET_STR(v, str); |
} else |
} else |
LOGERR; |
LOGERR; |
|
|
if (str) |
|
free(str); |
|
return ret; |
return ret; |
} |
} |
|
|