[ros-diffs] [mkupfer] 34156: small fix on string operations

mkupfer at svn.reactos.org mkupfer at svn.reactos.org
Sat Jun 28 16:16:39 CEST 2008


Author: mkupfer
Date: Sat Jun 28 09:16:39 2008
New Revision: 34156

URL: http://svn.reactos.org/svn/reactos?rev=34156&view=rev
Log:
small fix on string operations

Modified:
    branches/matthias-i18n/dll/win32/setupapi/parser.c

Modified: branches/matthias-i18n/dll/win32/setupapi/parser.c
URL: http://svn.reactos.org/svn/reactos/branches/matthias-i18n/dll/win32/setupapi/parser.c?rev=34156&r1=34155&r2=34156&view=diff
==============================================================================
--- branches/matthias-i18n/dll/win32/setupapi/parser.c [iso-8859-1] (original)
+++ branches/matthias-i18n/dll/win32/setupapi/parser.c [iso-8859-1] Sat Jun 28 09:16:39 2008
@@ -140,7 +140,6 @@
 static const WCHAR WindowsNT[]  = {'$','W','i','n','d','o','w','s',' ','N','T','$',0};
 static const WCHAR Windows95[]  = {'$','W','i','n','d','o','w','s',' ','9','5','$',0};
 static const WCHAR LayoutFile[] = {'L','a','y','o','u','t','F','i','l','e',0};
-static const WCHAR Strings[] = {'S','t','r','i','n','g','s',0};
 
 /* extend an array, allocating more memory if necessary */
 static void *grow_array( void *array, unsigned int *count, size_t elem )
@@ -316,7 +315,7 @@
     int dirid;
     WCHAR *dirid_str, *end;
     const WCHAR *ret = NULL;
-    WCHAR StringLangId[256];
+    WCHAR StringLangId[13] = {'S','t','r','i','n','g','s','.',0};
     TCHAR Lang[5];
 
     if (!*len)  /* empty string (%%) is replaced by single percent */
@@ -335,9 +334,7 @@
      if (j == strings_section->nb_lines || !line->nb_fields) goto not_found;
      field = &file->fields[line->first_field];
      GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_ILANGUAGE, Lang, sizeof(Lang)/sizeof(TCHAR)); // get the current system locale for translated strings
-     strcpyW(StringLangId, Strings); // build a new section name and use "Strings" at first
-     strcatW(StringLangId, L"."); // append a '.'
-     strcatW(StringLangId, Lang); // finally append the Language identifier from GetLocaleInfo
+     strcatW(StringLangId, Lang); // append the Language identifier from GetLocaleInfo
      // now you have e.g. Strings.0407 for german translations
      for (i = 0; i < file->nb_sections; i++) // search in all sections
      {



More information about the Ros-diffs mailing list