File tree 1 file changed +8
-4
lines changed
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[] = {
103
103
104
104
#define MAX_LOCALE_NAME_LEN 100
105
105
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 )
108
108
{
109
109
static char aliasbuf [MAX_LOCALE_NAME_LEN ];
110
110
int i ;
@@ -167,7 +167,7 @@ map_locale(struct locale_map *map, char *locale)
167
167
char *
168
168
pgwin32_setlocale (int category , const char * locale )
169
169
{
170
- char * argument ;
170
+ const char * argument ;
171
171
char * result ;
172
172
173
173
if (locale == NULL )
@@ -178,8 +178,12 @@ pgwin32_setlocale(int category, const char *locale)
178
178
/* Call the real setlocale() function */
179
179
result = setlocale (category , argument );
180
180
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
+ */
181
185
if (result )
182
- result = map_locale (locale_map_result , result );
186
+ result = ( char * ) map_locale (locale_map_result , result );
183
187
184
188
return result ;
185
189
}
You can’t perform that action at this time.
0 commit comments