]> git.tdb.fi Git - libs/core.git/blobdiff - source/time/timezone.cpp
Variable length arrays on stack are not valid C++
[libs/core.git] / source / time / timezone.cpp
index a755954b43628c9f66fb407f46b527fb7a54314f..a2cd7a3f772743c7fe9ac06fde3042fd6ab28d98 100644 (file)
@@ -61,7 +61,7 @@ TimeZone get_local_timezone()
                        long typecnt = get_long(ptr);
                        long charcnt = get_long(ptr);
                        int size = timecnt*5+typecnt*6+isgmtcnt+isstdcnt+leapcnt*8+charcnt;
-                       char buf[size];
+                       char *buf = new char[size];
                        len = read(fd, buf, size);
                        if(len==size)
                        {
@@ -91,6 +91,7 @@ TimeZone get_local_timezone()
 
                                name = ptr+abbrind;
                        }
+                       delete[] buf;
                }
                close(fd);