X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Flib%2Fgscphftaaux%2Fhfta_runtime_library.cc;fp=src%2Flib%2Fgscphftaaux%2Fhfta_runtime_library.cc;h=8396e4dcd6967ed58f0885c3a2eb908590c7e816;hb=6eada93445e22ce99c498c01e24fdf33783e1637;hp=5cabb200d7a379ee0f7c789d65417e827c701d44;hpb=2db1fd47cd7b8bbc850879e9236135a73037aee8;p=com%2Fgs-lite.git diff --git a/src/lib/gscphftaaux/hfta_runtime_library.cc b/src/lib/gscphftaaux/hfta_runtime_library.cc index 5cabb20..8396e4d 100644 --- a/src/lib/gscphftaaux/hfta_runtime_library.cc +++ b/src/lib/gscphftaaux/hfta_runtime_library.cc @@ -591,10 +591,12 @@ gs_param_handle_t register_handle_for_int_to_string_map_slot_1(vstring *filename return 0; } - char buf[10000], buf_str[10000]; - gs_int32_t buflen; + gs_int32_t buflen = 10000; + char buf[buflen], buf_str[buflen]; gs_int64_t val; - while(fgets(buf, buflen, fl) > 0){ + char *fret; + fret = fgets(buf, buflen, fl); + while(fret != NULL){ int nvals = sscanf(buf, "%lld,%s", &val, buf_str); if(nvals >= 2){ vstring new_str; @@ -604,6 +606,7 @@ gs_param_handle_t register_handle_for_int_to_string_map_slot_1(vstring *filename memcpy((char *)new_str.offset, buf_str, new_str.length); map_struct->i2s_map[val] = new_str; } + fret = fgets(buf, buflen, fl); } fclose(fl);