Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Side by Side Diff: third_party/libxml/src/error.c

Issue 1752223002: Roll libxml to 2.9.3 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re-cherry-pick fprintf formatting fix. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * error.c: module displaying/handling XML parser errors 2 * error.c: module displaying/handling XML parser errors
3 * 3 *
4 * See Copyright for the status of this software. 4 * See Copyright for the status of this software.
5 * 5 *
6 * Daniel Veillard <daniel@veillard.com> 6 * Daniel Veillard <daniel@veillard.com>
7 */ 7 */
8 8
9 #define IN_LIBXML 9 #define IN_LIBXML
10 #include "libxml.h" 10 #include "libxml.h"
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 */ 170 */
171 171
172 static void 172 static void
173 xmlParserPrintFileContextInternal(xmlParserInputPtr input , 173 xmlParserPrintFileContextInternal(xmlParserInputPtr input ,
174 xmlGenericErrorFunc channel, void *data ) { 174 xmlGenericErrorFunc channel, void *data ) {
175 const xmlChar *cur, *base; 175 const xmlChar *cur, *base;
176 unsigned int n, col; /* GCC warns if signed, because compared with si zeof() */ 176 unsigned int n, col; /* GCC warns if signed, because compared with si zeof() */
177 xmlChar content[81]; /* space for 80 chars + line terminator */ 177 xmlChar content[81]; /* space for 80 chars + line terminator */
178 xmlChar *ctnt; 178 xmlChar *ctnt;
179 179
180 if (input == NULL) return; 180 if ((input == NULL) || (input->cur == NULL) ||
181 (*input->cur == 0)) return;
182
181 cur = input->cur; 183 cur = input->cur;
182 base = input->base; 184 base = input->base;
183 /* skip backwards over any end-of-lines */ 185 /* skip backwards over any end-of-lines */
184 while ((cur > base) && ((*(cur) == '\n') || (*(cur) == '\r'))) { 186 while ((cur > base) && ((*(cur) == '\n') || (*(cur) == '\r'))) {
185 cur--; 187 cur--;
186 } 188 }
187 n = 0; 189 n = 0;
188 /* search backwards for beginning-of-line (to max buff size) */ 190 /* search backwards for beginning-of-line (to max buff size) */
189 while ((n++ < (sizeof(content)-1)) && (cur > base) && 191 while ((n++ < (sizeof(content)-1)) && (cur > base) &&
190 (*(cur) != '\n') && (*(cur) != '\r')) 192 (*(cur) != '\n') && (*(cur) != '\r'))
(...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after
987 to->file = file; 989 to->file = file;
988 to->str1 = str1; 990 to->str1 = str1;
989 to->str2 = str2; 991 to->str2 = str2;
990 to->str3 = str3; 992 to->str3 = str3;
991 993
992 return 0; 994 return 0;
993 } 995 }
994 996
995 #define bottom_error 997 #define bottom_error
996 #include "elfgcchack.h" 998 #include "elfgcchack.h"
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698