Skip to content

Commit

Permalink
small typo (#4632)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelChirico authored Jul 26, 2020
1 parent 4fd649e commit db61844
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/fmelt.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ SEXP whichwrapper(SEXP x, SEXP val) {
}

static const char *concat(SEXP vec, SEXP idx) {
if (!isString(vec)) error(_("concat: 'vec must be a character vector"));
if (!isString(vec)) error(_("concat: 'vec' must be a character vector"));
if (!isInteger(idx) || length(idx) < 0) error(_("concat: 'idx' must be an integer vector of length >= 0"));

static char ans[1024]; // so only one call to concat() per calling warning/error
int nidx=length(idx), nvec=length(vec);
ans[0]='\0';
Expand All @@ -81,7 +81,7 @@ static const char *concat(SEXP vec, SEXP idx) {
for (; i<nidx; ++i) {
SEXP this = STRING_ELT(vec, iidx[i]-1);
int len = length(this);
if (len>remaining) break;
if (len>remaining) break;
strncpy(pos, CHAR(this), len);
pos+=len;
remaining-=len;
Expand All @@ -104,13 +104,13 @@ SEXP measurelist(SEXP measure, SEXP dtnames) {
for (int i=0; i<n; ++i) {
SEXP x = VECTOR_ELT(measure, i);
switch(TYPEOF(x)) {
case STRSXP :
case STRSXP :
SET_VECTOR_ELT(ans, i, chmatch(x, dtnames, 0));
break;
case REALSXP :
SET_VECTOR_ELT(ans, i, coerceVector(x, INTSXP));
break;
case INTSXP :
case INTSXP :
SET_VECTOR_ELT(ans, i, x);
break;
default :
Expand Down

0 comments on commit db61844

Please sign in to comment.