diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2008-10-13 20:34:12 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2008-10-13 20:34:12 +0000 |
commit | 28c1518dc93984a96b373daafef1ff07c88d62fb (patch) | |
tree | f8d74df9df20bd9cb18d9ee1ed12645a73ce3633 /app/luit/parser.c | |
parent | 2b0b095090d200dbb52cedaf835e295aa928bcd3 (diff) |
luit 1.0.3
Diffstat (limited to 'app/luit/parser.c')
-rw-r--r-- | app/luit/parser.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/app/luit/parser.c b/app/luit/parser.c index 2ccd144f0..0c8023fcd 100644 --- a/app/luit/parser.c +++ b/app/luit/parser.c @@ -167,7 +167,7 @@ parseTwoTokenLine(FILE *f, char *first, char *second) } char * -resolveLocale(char *locale) +resolveLocale(const char *locale) { FILE *f; char first[MAX_KEYWORD_LENGTH], second[MAX_KEYWORD_LENGTH]; @@ -183,19 +183,17 @@ resolveLocale(char *locale) if(rc < -1) goto bail; if(!strcmp(first, locale)) { - resolved = malloc(strlen(second) + 1); + resolved = strdup(second); if(resolved == NULL) goto bail; - strcpy(resolved, second); break; } } while(rc >= 0); if(resolved == NULL) { - resolved = malloc(strlen(locale) + 1); + resolved = strdup(locale); if(resolved == NULL) goto bail; - strcpy(resolved, locale); } fclose(f); |