diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/interface.c | 8 | ||||
| -rw-r--r-- | src/main.c | 6 |
2 files changed, 11 insertions, 3 deletions
diff --git a/src/interface.c b/src/interface.c index 3b89c2a..3309868 100644 --- a/src/interface.c +++ b/src/interface.c @@ -3408,12 +3408,16 @@ int search_ui(pixel *vid_buf) thumb_cache_add(img_id[i], thumb, thlen); for (pos=0; pos<GRID_X*GRID_Y; pos++) { if (search_dates[pos]) { - char *id_d_temp = malloc(strlen(search_ids[pos])+strlen(search_dates[pos])+1); + char *id_d_temp = malloc(strlen(search_ids[pos])+strlen(search_dates[pos])+2); + if (id_d_temp == 0) + { + break; + } strcpy(id_d_temp, search_ids[pos]); strappend(id_d_temp, "_"); strappend(id_d_temp, search_dates[pos]); //img_id[i] = mystrdup(id_d_temp); - if (id_d_temp && !strcmp(id_d_temp, img_id[i])) { + if (!strcmp(id_d_temp, img_id[i])) { break; } } else { @@ -3546,7 +3546,11 @@ int main(int argc, char *argv[]) if (sdl_mod&(KMOD_CAPS)) strappend(uitext, " [CAP LOCKS]"); if (GRID_MODE) - sprintf(uitext, "%s [GRID: %d]", uitext, GRID_MODE); //TODO: Undefined behavior: variable is used as parameter and destination in sprintf(). + { + char gridtext[15]; + sprintf(gridtext, " [GRID: %d]", GRID_MODE); + strappend(uitext, gridtext); + } #ifdef INTERNAL if (vs) strappend(uitext, " [FRAME CAPTURE]"); |
