@@ -2257,8 +2257,7 @@ int freadMain(freadMainArgs _args) {
22572257 int max_col = 0 ;
22582258 char * typeBumpMsg = NULL ; size_t typeBumpMsgSize = 0 ;
22592259 int typeCounts [NUMTYPE ]; // used for verbose output; needs populating after first read and before reread (if any) -- see later comment
2260- #define internalErrSize 1000
2261- char internalErr [internalErrSize + 1 ]= "" ; // must be compile time size: the message is generated and we can't free before STOP
2260+ char internalErr [1001 ]= "" ; // must be compile time size: the message is generated and we can't free before STOP
22622261 int64_t DTi = 0 ; // the current row number in DT that we are writing to
22632262 const char * headPos = pos ; // the jump start corresponding to DTi
22642263 int nSwept = 0 ; // count the number of dirty jumps that were swept
@@ -2314,7 +2313,7 @@ int freadMain(freadMainArgs _args) {
23142313 nth = omp_get_num_threads ();
23152314 if (me != 0 ) {
23162315 // # nocov start
2317- snprintf (internalErr , internalErrSize , "Master thread is not thread 0 but thread %d.\n" , me ); // # notranslate
2316+ snprintf (internalErr , sizeof ( internalErr ) - 1 , "Master thread is not thread 0 but thread %d.\n" , me ); // # notranslate
23182317 stopTeam = true;
23192318 // # nocov end
23202319 }
@@ -2583,7 +2582,7 @@ int freadMain(freadMainArgs _args) {
25832582 }
25842583 else if (headPos != thisJumpStart && nrowLimit > 0 ) { // do not care for dirty jumps since we do not read data and only want to know types
25852584 // # nocov start
2586- snprintf (internalErr , internalErrSize , "invalid head position. jump=%d, headPos=%p, thisJumpStart=%p, sof=%p" , jump , headPos , thisJumpStart , sof ); // # notranslate
2585+ snprintf (internalErr , sizeof ( internalErr ) - 1 , "invalid head position. jump=%d, headPos=%p, thisJumpStart=%p, sof=%p" , jump , headPos , thisJumpStart , sof ); // # notranslate
25872586 stopTeam = true;
25882587 // # nocov end
25892588 }
0 commit comments