Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ mudclient.data
mudclient.html
mudclient.js
mudclient.wasm
mudclient.wasm.js
.idea
options.ini
rsc-c.3dsx
Expand Down
2 changes: 1 addition & 1 deletion Makefile.emscripten
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ CFLAGS += -s DISABLE_EXCEPTION_THROWING=1

LDFLAGS += -s INITIAL_MEMORY=50MB -s ALLOW_MEMORY_GROWTH=1 -s USE_SDL=2
LDFLAGS += -s ASYNCIFY -s ASYNCIFY_STACK_SIZE=16384
LDFLAGS += -s MIN_FIREFOX_VERSION=52
LDFLAGS += -s MIN_FIREFOX_VERSION=68

LDFLAGS += --preload-file ./cache/

Expand Down
8 changes: 5 additions & 3 deletions src/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ void options_save(Options *options) {
return;
}

char file_buffer[65536] = {0};
int file_length = UINT16_MAX + 1;
char *file_buffer = calloc(1, file_length);

sprintf(file_buffer, OPTIONS_INI_TEMPLATE,
options->members, //
Expand Down Expand Up @@ -306,17 +307,18 @@ void options_save(Options *options) {
);

#ifdef ANDROID
if (SDL_RWwrite(ini_file, file_buffer, strlen(file_buffer) + 1, 1) < 1) {
if (SDL_RWwrite(ini_file, file_buffer, file_length, 1) < 1) {
mud_error("failed to write options.ini file %s\n", SDL_GetError());
}

if (SDL_RWclose(ini_file) != 0) {
mud_error("failed to close options.ini file %s\n", SDL_GetError());
}
#else
fwrite(file_buffer, strlen(file_buffer) + 1, 1, ini_file);
fwrite(file_buffer, file_length, 1, ini_file);
fclose(ini_file);
#endif
free(file_buffer);

#ifdef OPTIONS_UNIX
/* restrict access to potentially sensitive info */
Expand Down
2 changes: 2 additions & 0 deletions src/surface.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ void surface_new(Surface *surface, int width, int height, int limit,
mudclient *mud);

#if defined(RENDER_GL) || defined(RENDER_3DS_GL)
void surface_gl_new(Surface *surface, int width, int height, int limit,
mudclient *mud);
float surface_gl_translate_x(Surface *surface, int x);
float surface_gl_translate_y(Surface *surface, int y);
void surface_gl_reset_context(Surface *surface);
Expand Down