Permalink
Browse files

Trying to fix the build issue when allocating dynamic size array (#4765)

  • Loading branch information...
szekerest committed Sep 28, 2013
1 parent e208e84 commit 4eebb1a8596d95dfebe7caec7c91d926f3364818
Showing with 2 additions and 1 deletion.
  1. +2 −1 maputfgrid.cpp
@@ -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. */
@@ -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,"\"");
}

0 comments on commit 4eebb1a

Please sign in to comment.