diff -ru Hmisc.orig/src/mChoice.c Hmisc/src/mChoice.c --- Hmisc.orig/src/mChoice.c 2012-03-27 14:31:59.000000000 -0400 +++ Hmisc/src/mChoice.c 2012-04-13 18:13:12.000000000 -0400 @@ -63,12 +63,11 @@ SEXP elm_index; /* Storage for value of first row of first match of each element in x *\/ */ R_len_t len; /* Number of elements in x */ - R_len_t t_len; /* Number of elements in table */ R_len_t nfound; /* count of number of elements of x matched in table */ char *str_ptr; /* current location pointer */ const char *str; - int i, j, k, comp, slen; + int i, j, comp, slen; S_EVALUATOR /* get number of elements in x */ @@ -81,6 +80,7 @@ memset((int *)INTEGER_POINTER(elm_index), 0, len * sizeof(int)); /* count number of x values that are zero and set nfound to that */ + nfound = 0; for(i=0; i < len; i++) { if(INTEGER_POINTER(x)[i] == 0) { INTEGER_POINTER(elm_index)[i] = INTEGER_POINTER(nomatch)[0];