Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of azure_c_shared_utility by
Revision 9:079c39803432, committed 2016-08-12
- Comitter:
- AzureIoTClient
- Date:
- Fri Aug 12 13:49:58 2016 -0700
- Parent:
- 8:3db46d1e5471
- Child:
- 10:1be0bc9a9deb
- Commit message:
- 1.0.10
Changed in this revision
| strings.c | Show annotated file Show diff for this revision Revisions of this file |
--- a/strings.c Fri Aug 12 10:04:46 2016 -0700
+++ b/strings.c Fri Aug 12 13:49:58 2016 -0700
@@ -128,10 +128,11 @@
if (format != NULL)
{
va_list arg_list;
+ int length;
va_start(arg_list, format);
/* Codes_SRS_STRING_07_041: [STRING_construct_sprintf shall determine the size of the resulting string and allocate the necessary memory.] */
- int length = vsnprintf(NULL, 0, format, arg_list);
+ length = vsnprintf(NULL, 0, format, arg_list);
va_end(arg_list);
if (length > 0)
{
@@ -512,9 +513,10 @@
else
{
va_list arg_list;
+ int s2Length;
va_start(arg_list, format);
- int s2Length = vsnprintf(NULL, 0, format, arg_list);
+ s2Length = vsnprintf(NULL, 0, format, arg_list);
va_end(arg_list);
if (s2Length < 0)
{
@@ -530,8 +532,9 @@
else
{
STRING* s1 = (STRING*)handle;
+ char* temp;
size_t s1Length = strlen(s1->s);
- char* temp = (char*)realloc(s1->s, s1Length + s2Length + 1);
+ temp = (char*)realloc(s1->s, s1Length + s2Length + 1);
if (temp != NULL)
{
s1->s = temp;
