Skip to content

Commit cf898ab

Browse files
authored
add correct initializer
1 parent 9cee828 commit cf898ab

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/fifelse.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,14 +217,14 @@ SEXP fcaseR(SEXP rho, SEXP args) {
217217
int nprotect=0, l;
218218
int64_t n_ans=0, n_this_arg=0, n_undecided=0;
219219
SEXP ans=R_NilValue, tracker=R_NilValue, whens=R_NilValue, thens=R_NilValue;
220-
SEXP ans_class, ans_levels;
220+
SEXP ans_class, ans_levels = R_NilValue;
221221
PROTECT_INDEX Iwhens, Ithens;
222222
PROTECT_WITH_INDEX(whens, &Iwhens); nprotect++;
223223
PROTECT_WITH_INDEX(thens, &Ithens); nprotect++;
224224
SEXPTYPE ans_type=NILSXP;
225225
// naout means if the output is scalar logic na
226226
bool imask = true, naout = false, idefault = false;
227-
bool ans_is_factor;
227+
bool ans_is_factor = false;
228228
int *restrict p = NULL;
229229
const int n = narg/2;
230230
for (int i=0; i<n; ++i) {

src/fread.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1689,7 +1689,7 @@ int freadMain(freadMainArgs _args)
16891689
if (ch >= eof) STOP(_("Input is either empty, fully whitespace, or skip has been set after the last non-whitespace."));
16901690
if (verbose) {
16911691
if (lineStart > ch) DTPRINT(_(" Moved forward to first non-blank line (%d)\n"), row1line);
1692-
DTPRINT(_(" Positioned on line %d starting: <<%s>>\n"), row1line, strlim(lineStart, (char[500]) {}, 30));
1692+
DTPRINT(_(" Positioned on line %d starting: <<%s>>\n"), row1line, strlim(lineStart, (char[500]) {0}, 30));
16931693
}
16941694
ch = pos = lineStart;
16951695
}
@@ -1880,7 +1880,7 @@ int freadMain(freadMainArgs _args)
18801880
if (!fill && tt != ncol) INTERNAL_STOP("first line has field count %d but expecting %d", tt, ncol); // # nocov
18811881
if (verbose) {
18821882
DTPRINT(_(" Detected %d columns on line %d. This line is either column names or first data row. Line starts as: <<%s>>\n"),
1883-
tt, row1line, strlim(pos, (char[500]) {}, 30));
1883+
tt, row1line, strlim(pos, (char[500]) {0}, 30));
18841884
DTPRINT(_(" Quote rule picked = %d\n"), quoteRule);
18851885
DTPRINT(_(" fill=%s and the most number of columns found is %d\n"), fill ? "true" : "false", ncol);
18861886
}
@@ -2809,23 +2809,23 @@ int freadMain(freadMainArgs _args)
28092809
while (ch < eof && *ch != '\n' && *ch != '\r') ch++;
28102810
while (ch < eof && isspace(*ch)) ch++;
28112811
if (ch == eof) {
2812-
DTWARN(_("Discarded single-line footer: <<%s>>"), strlim(skippedFooter, (char[500]) {}, 500));
2812+
DTWARN(_("Discarded single-line footer: <<%s>>"), strlim(skippedFooter, (char[500]) {0}, 500));
28132813
}
28142814
else {
28152815
ch = headPos;
28162816
int tt = countfields(&ch);
28172817
if (fill > 0) {
28182818
DTWARN(_("Stopped early on line %"PRId64". Expected %d fields but found %d. Consider fill=%d or even more based on your knowledge of the input file. Use fill=Inf for reading the whole file for detecting the number of fields. First discarded non-empty line: <<%s>>"),
2819-
DTi + row1line, ncol, tt, tt, strlim(skippedFooter, (char[500]) {}, 500));
2819+
DTi + row1line, ncol, tt, tt, strlim(skippedFooter, (char[500]) {0}, 500));
28202820
} else {
28212821
DTWARN(_("Stopped early on line %"PRId64". Expected %d fields but found %d. Consider fill=TRUE. First discarded non-empty line: <<%s>>"),
2822-
DTi + row1line, ncol, tt, strlim(skippedFooter, (char[500]) {}, 500));
2822+
DTi + row1line, ncol, tt, strlim(skippedFooter, (char[500]) {0}, 500));
28232823
}
28242824
}
28252825
}
28262826
}
28272827
if (quoteRuleBumpedCh != NULL && quoteRuleBumpedCh < headPos) {
2828-
DTWARN(_("Found and resolved improper quoting out-of-sample. First healed line %"PRId64": <<%s>>. If the fields are not quoted (e.g. field separator does not appear within any field), try quote=\"\" to avoid this warning."), quoteRuleBumpedLine, strlim(quoteRuleBumpedCh, (char[500]) {}, 500));
2828+
DTWARN(_("Found and resolved improper quoting out-of-sample. First healed line %"PRId64": <<%s>>. If the fields are not quoted (e.g. field separator does not appear within any field), try quote=\"\" to avoid this warning."), quoteRuleBumpedLine, strlim(quoteRuleBumpedCh, (char[500]) {0}, 500));
28292829
}
28302830

28312831
if (verbose) {

0 commit comments

Comments
 (0)