Ticket #39: strftime_fix.patch
File strftime_fix.patch, 683 bytes (added by , 12 years ago) |
---|
-
systeminfo.cpp
old new 172 172 #if defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_OS_OS2) 173 173 time_t x; 174 174 time(&x); 175 char str[256] ;175 char str[256] = "\0"; 176 176 char fmt[32]; 177 177 strcpy(fmt, "%z"); 178 178 strftime(str, 256, fmt, localtime(&x)); 179 if( strcmp(fmt, str)) {179 if(*str && strcmp(fmt, str)) { 180 180 QString s = str; 181 181 if(s.at(0) == '+') 182 182 s.remove(0,1); … … 185 185 } 186 186 strcpy(fmt, "%Z"); 187 187 strftime(str, 256, fmt, localtime(&x)); 188 if( strcmp(fmt, str))188 if(*str && strcmp(fmt, str)) 189 189 timezone_str_ = str; 190 190 #endif 191 191 #if defined(Q_WS_X11)