ENHANCE: skip build_complete_strings() when nsegtok is 0.
@@ -579,9 +579,11 @@ int tokenize_sblocks(mblck_list_t *blist, int length, char delimiter, int keycnt
if (finish_flag == false) {
return -1; /* some errors */
}
+ if (nsegtok > 0) {
if (build_complete_strings(blist, segtoks, nsegtok, tokens, ntokens) != 0) {
return -2; /* out of memory */
}
+ }
return 0; /* OK */
}
#endif
