Skip to content

Commit

Permalink
Trying to fix the build issue when allocating dynamic size array (#4765)
Browse files Browse the repository at this point in the history
  • Loading branch information
szekerest committed Sep 28, 2013
1 parent e208e84 commit 4eebb1a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion maputfgrid.cpp
Expand Up @@ -380,7 +380,7 @@ int utfgridSaveImage(imageObj *img, mapObj *map, FILE *fp, outputFormatObj *form
/* Print the buffer, also */
for(row=0; row<imgheight; row++) {

wchar_t string[imgwidth + 1];
wchar_t *string = (wchar_t*) msSmallMalloc ((imgwidth + 1) * sizeof(wchar_t));
wchar_t *stringptr;
stringptr = string;
/* Needs comma between each lines but JSON must not start with a comma. */
Expand All @@ -401,6 +401,7 @@ int utfgridSaveImage(imageObj *img, mapObj *map, FILE *fp, outputFormatObj *form
utf8 = msConvertWideStringToUTF8 (string, "UCS-4LE");
fprintf(fp,"%s", utf8);
msFree(utf8);
msFree(string);
fprintf(fp,"\"");
}

Expand Down

0 comments on commit 4eebb1a

Please sign in to comment.