Commit 43150646 431506466774567083c52a2cf5f9517aa1671826 by Sergey Poznyakoff

(stream_getline,parse_content_type): A couple of bugfixes.

1 parent e526dcb7
Showing 1 changed file with 2 additions and 2 deletions
...@@ -1593,7 +1593,7 @@ stream_getline (stream_t str, char **buf, size_t *bufsize, size_t *pnum) ...@@ -1593,7 +1593,7 @@ stream_getline (stream_t str, char **buf, size_t *bufsize, size_t *pnum)
1593 numread += n; 1593 numread += n;
1594 if ((*buf)[numread - 1] != '\n') 1594 if ((*buf)[numread - 1] != '\n')
1595 { 1595 {
1596 if (numread == *bufsize) 1596 if (numread + 1 == *bufsize)
1597 { 1597 {
1598 *bufsize += 128; 1598 *bufsize += 128;
1599 *buf = xrealloc (*buf, *bufsize); 1599 *buf = xrealloc (*buf, *bufsize);
...@@ -1663,6 +1663,7 @@ parse_content_type (struct compose_env *env, ...@@ -1663,6 +1663,7 @@ parse_content_type (struct compose_env *env,
1663 1663
1664 while (stop == 0 && status == 0 && *rest) 1664 while (stop == 0 && status == 0 && *rest)
1665 { 1665 {
1666 skipws (rest);
1666 switch (*rest++) 1667 switch (*rest++)
1667 { 1668 {
1668 case '(': 1669 case '(':
...@@ -1742,7 +1743,6 @@ parse_content_type (struct compose_env *env, ...@@ -1742,7 +1743,6 @@ parse_content_type (struct compose_env *env,
1742 stop = 1; 1743 stop = 1;
1743 break; 1744 break;
1744 } 1745 }
1745 skipws (rest);
1746 } 1746 }
1747 1747
1748 if (comment) 1748 if (comment)
......