1 diff -urN poldek-0.30-cvs20080820.23/misc.c poldek-0.30-cvs20080820.23.new/misc.c
2 --- poldek-0.30-cvs20080820.23/misc.c 2008-07-19 11:52:31.000000000 +0200
3 +++ poldek-0.30-cvs20080820.23.new/misc.c 2008-11-23 15:54:42.835970687 +0100
6 static char *cut_country_code (const char *lang)
8 - char *p, *q, *newlang;
9 + char *c, *p, *q, *newlang;
11 if ((q = strchr(lang, '_')) == NULL)
15 p = n_strncpy(newlang, lang, q - lang + 1);
17 - if ((q = strchr(lang, '.')))
18 - n_strncpy(p, q, strlen(q) + 1);
19 - else if ((q = strchr(lang, '@')))
20 - n_strncpy(p, q, strlen(q) + 1);
21 + if ((c = strchr(q, '.')))
22 + n_strncpy(p, c, strlen(c) + 1);
23 + else if ((c = strchr(q, '@')))
24 + n_strncpy(p, c, strlen(c) + 1);
26 + n_assert(strlen(lang) > strlen(newlang));