mirror of
https://github.com/tstellar/bygfoot.git
synced 2024-12-17 10:50:12 +01:00
changed some variable types from gchar buf[SMALL] to GString *buf.
A bug causes bygfoot to crash in file_compress_files. Bug message: In file.c/file_compress_files, we used gchar buf[SMALL]; SMALL is defined to 10000. after a lot of seasons (19 within the test), the number of files grows too big.
This commit is contained in:
parent
99ff0ea1a5
commit
6a28c1cd6e
13
src/user.c
13
src/user.c
@ -993,16 +993,17 @@ user_show_sponsor_continue(void)
|
||||
void
|
||||
user_mm_load_file(const gchar *filename, GArray *mmatches)
|
||||
{
|
||||
gchar prefix[SMALL], filename_local[SMALL],
|
||||
GString *prefix = g_string_new("");
|
||||
gchar filename_local[SMALL],
|
||||
matches_file[SMALL];
|
||||
GArray *mm_array = (mmatches == NULL) ?
|
||||
current_user.mmatches : mmatches;
|
||||
|
||||
strcpy(filename_local, filename);
|
||||
strncpy(prefix, filename_local, strlen(filename_local) - 8);
|
||||
prefix[strlen(filename_local) - 8] = '\0';
|
||||
g_string_append_len(prefix, filename_local, strlen(filename_local) - 8);
|
||||
//prefix[strlen(filename_local) - 8] = '\0';
|
||||
|
||||
sprintf(matches_file, "%s___mmatches", prefix);
|
||||
sprintf(matches_file, "%s___mmatches", prefix->str);
|
||||
|
||||
file_decompress(filename_local);
|
||||
|
||||
@ -1011,11 +1012,13 @@ user_mm_load_file(const gchar *filename, GArray *mmatches)
|
||||
|
||||
xml_mmatches_read(matches_file, mm_array);
|
||||
|
||||
strcat(prefix, "___*");
|
||||
g_string_append(prefix, "___*");
|
||||
file_remove_files(prefix);
|
||||
|
||||
if(mmatches == NULL)
|
||||
misc_string_assign(¤t_user.mmatches_file, filename_local);
|
||||
|
||||
g_string_free(prefix, TRUE);
|
||||
}
|
||||
|
||||
/** Add the last match to the MM file.
|
||||
|
Loading…
Reference in New Issue
Block a user