Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
lang_codes: fix lang_code_user() malloc
  • Loading branch information
perexg committed Oct 6, 2015
1 parent b51867f commit b2cac44
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lang_codes.c
Expand Up @@ -705,7 +705,7 @@ char *lang_code_user( const char *ucode )
return ucode ? strdup(ucode) : NULL;
if (!ucode)
return codes ? strdup(codes) : NULL;
ret = malloc(strlen(codes) + strlen(ucode ?: "") + 1);
ret = malloc(strlen(codes) + strlen(ucode ?: "") + 2);
strcpy(ret, ucode);
while (codes && *codes) {
s = codes;
Expand Down

0 comments on commit b2cac44

Please sign in to comment.