]> git.tdb.fi Git - libs/core.git/blobdiff - source/time/timezone.cpp
Clean up after the timedelta.h/units.h merge
[libs/core.git] / source / time / timezone.cpp
index 873829d667111f86a3e96dbd164d89606f5183d1..7baf4943bec4b436c479d06d4394c9004f91f2d3 100644 (file)
@@ -2,13 +2,13 @@
 #ifdef WIN32
 #include <windows.h>
 #else
+#include <unistd.h>
 #include <fcntl.h>
 #endif
 #include <msp/strings/format.h>
 #include <msp/core/systemerror.h>
 #include "timestamp.h"
 #include "timezone.h"
-#include "units.h"
 #include "utils.h"
 
 using namespace std;
@@ -60,7 +60,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)
                        {
@@ -90,6 +90,7 @@ TimeZone get_local_timezone()
 
                                name = ptr+abbrind;
                        }
+                       delete[] buf;
                }
                close(fd);