Skip to content

Commit

Permalink
Revert printf format strings; fix more comment alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffknupp committed Jul 21, 2017
1 parent 3171674 commit e4dfd19
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pandas/_libs/parsers.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ cdef extern from "parser/tokenizer.h":
io_cleanup cb_cleanup

int64_t chunksize # Number of bytes to prepare for each chunk
char *data # pointer to data to be processed
char *data # pointer to data to be processed
int64_t datalen # amount of data available
int64_t datapos

Expand Down
8 changes: 4 additions & 4 deletions pandas/_libs/src/parser/tokenizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ static int end_line(parser_t *self) {
if (self->error_bad_lines) {
self->error_msg = (char *)malloc(bufsize);
snprintf(self->error_msg, bufsize,
"Expected %d fields in line %zu, saw %d\n",
"Expected %d fields in line %d, saw %d\n",
ex_fields, self->file_lines, fields);

TRACE(("Error at line %d, %d fields\n", self->file_lines, fields));
Expand All @@ -480,7 +480,7 @@ static int end_line(parser_t *self) {
// pass up error message
msg = (char *)malloc(bufsize);
snprintf(msg, bufsize,
"Skipping line %zu: expected %d fields, saw %d\n",
"Skipping line %d: expected %d fields, saw %d\n",
self->file_lines, ex_fields, fields);
append_warning(self, msg);
free(msg);
Expand Down Expand Up @@ -1147,7 +1147,7 @@ static int parser_handle_eof(parser_t *self) {
case IN_QUOTED_FIELD:
self->error_msg = (char *)malloc(bufsize);
snprintf(self->error_msg, bufsize,
"EOF inside string starting at line %zu", self->file_lines);
"EOF inside string starting at line %d", self->file_lines);
return -1;

case ESCAPED_CHAR:
Expand Down Expand Up @@ -1323,7 +1323,7 @@ void debug_print_parser(parser_t *self) {
char *token;

for (line = 0; line < self->lines; ++line) {
printf("(Parsed) Line %zu: ", line);
printf("(Parsed) Line %d: ", line);

for (j = 0; j < self->line_fields[j]; ++j) {
token = self->words[j + self->line_start[line]];
Expand Down

0 comments on commit e4dfd19

Please sign in to comment.