Changeset 12359
- Timestamp:
- 10/09/07 13:54:26 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.4/gdal/ogr/ogrsf_frmts/mitab/mitab_datfile.cpp
r6276 r12359 820 820 const char *TABDATFile::ReadCharField(int nWidth) 821 821 { 822 // We know that character strings are limited to 254 chars in MapInfo823 static char szBuf[256];824 825 822 // If current record has been deleted, then return an acceptable 826 823 // default value. … … 842 839 } 843 840 844 if (m_poRecordBlock->ReadBytes(nWidth, (GByte*) szBuf) != 0)841 if (m_poRecordBlock->ReadBytes(nWidth, (GByte*)m_szBuffer) != 0) 845 842 return ""; 846 843 847 szBuf[nWidth] = '\0';844 m_szBuffer[nWidth] = '\0'; 848 845 849 846 // NATIVE tables are padded with '\0' chars, but DBF tables are padded … … 851 848 if (m_eTableType == TABTableDBF) 852 849 { 853 int nLen = strlen( szBuf)-1;854 while(nLen>=0 && szBuf[nLen] == ' ')855 szBuf[nLen--] = '\0';856 } 857 858 return szBuf;850 int nLen = strlen(m_szBuffer)-1; 851 while(nLen>=0 && m_szBuffer[nLen] == ' ') 852 m_szBuffer[nLen--] = '\0'; 853 } 854 855 return m_szBuffer; 859 856 } 860 857 … … 1012 1009 { 1013 1010 int nDay, nMonth, nYear; 1014 static char szBuf[20];1015 1011 1016 1012 // If current record has been deleted, then return an acceptable … … 1039 1035 return ""; 1040 1036 1041 sprintf( szBuf, "%4.4d%2.2d%2.2d", nYear, nMonth, nDay);1042 1043 return szBuf;1037 sprintf(m_szBuffer, "%4.4d%2.2d%2.2d", nYear, nMonth, nDay); 1038 1039 return m_szBuffer; 1044 1040 } 1045 1041 branches/1.4/gdal/ogr/ogrsf_frmts/mitab/mitab_priv.h
r11168 r12359 1482 1482 int WriteHeader(); 1483 1483 1484 // We know that character strings are limited to 254 chars in MapInfo 1485 // Using a buffer pr. class instance to avoid threading issues with the library 1486 char m_szBuffer[256]; 1487 1484 1488 public: 1485 1489 TABDATFile();
