diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-03-31 19:22:41 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-03-31 19:22:41 +0000 |
commit | 51bb497c3e4dae08db5affc6fbf91b0a2eddae3f (patch) | |
tree | 242f14b4c64f7bffd4be5a88fb283d5175211796 | |
parent | e979b2bccf103e93e138b86c967858e63b539f46 (diff) | |
download | wyslij-po-51bb497c3e4dae08db5affc6fbf91b0a2eddae3f.tar.gz wyslij-po-51bb497c3e4dae08db5affc6fbf91b0a2eddae3f.tar.bz2 |
Bugfix
* src/po.c (po_header): Fix the header scanning loop
-rw-r--r-- | src/po.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -221,15 +221,18 @@ po_header (const char *name) break; if (*p == '"' && p[len - 1] == '"') { - p[--len] = 0; + p[len-1] = 0; + len -= 2; p++; } - if (size < bufsize) + if (len == 0) + continue; + if (size < len + 1) { - size = bufsize; + size = len + 1; str = xrealloc (str, size); } - mu_wordsplit_c_unquote_copy (str, p, size); + mu_wordsplit_c_unquote_copy (str, p, len); obstack_grow (&stk, str, strlen (str)); } obstack_1grow (&stk, '\n'); |