File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -103,8 +103,8 @@ static const struct locale_map locale_map_result[] = {
103103
104104#define MAX_LOCALE_NAME_LEN 100
105105
106- static char *
107- map_locale (struct locale_map * map , char * locale )
106+ static const char *
107+ map_locale (const struct locale_map * map , const char * locale )
108108{
109109 static char aliasbuf [MAX_LOCALE_NAME_LEN ];
110110 int i ;
@@ -167,7 +167,7 @@ map_locale(struct locale_map *map, char *locale)
167167char *
168168pgwin32_setlocale (int category , const char * locale )
169169{
170- char * argument ;
170+ const char * argument ;
171171 char * result ;
172172
173173 if (locale == NULL )
@@ -178,8 +178,12 @@ pgwin32_setlocale(int category, const char *locale)
178178 /* Call the real setlocale() function */
179179 result = setlocale (category , argument );
180180
181+ /*
182+ * setlocale() is specified to return a "char *" that the caller is
183+ * forbidden to modify, so casting away the "const" is innocuous.
184+ */
181185 if (result )
182- result = map_locale (locale_map_result , result );
186+ result = ( char * ) map_locale (locale_map_result , result );
183187
184188 return result ;
185189}
You can’t perform that action at this time.
0 commit comments