diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-09-26 16:12:18 +0200 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-09-26 16:12:18 +0200 |
| commit | 2ffd4e4f1af16b17a286ff354603a717f5d828a5 (patch) | |
| tree | 99e2d4a7e2fde8e3abb027eb687901440750ee00 /src/drivers/Posix/Fl_Posix_System_Driver.cxx | |
| parent | 53d9614adbb728fc4db983c9bb817c6eea870994 (diff) | |
Replace all calls to sprintf() by calls to snprintf().
Diffstat (limited to 'src/drivers/Posix/Fl_Posix_System_Driver.cxx')
| -rw-r--r-- | src/drivers/Posix/Fl_Posix_System_Driver.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/drivers/Posix/Fl_Posix_System_Driver.cxx b/src/drivers/Posix/Fl_Posix_System_Driver.cxx index 9cb4656af..6e90cb5eb 100644 --- a/src/drivers/Posix/Fl_Posix_System_Driver.cxx +++ b/src/drivers/Posix/Fl_Posix_System_Driver.cxx @@ -177,16 +177,16 @@ int Fl_Posix_System_Driver::run_program(const char *program, char **argv, char * static void* quadruple_dlopen(const char *libname) { char filename2[FL_PATH_MAX]; - sprintf(filename2, "%s.so", libname); + snprintf(filename2, FL_PATH_MAX, "%s.so", libname); void *ptr = dlopen(filename2, RTLD_LAZY | RTLD_GLOBAL); if (!ptr) { - sprintf(filename2, "%s.so.2", libname); + snprintf(filename2, FL_PATH_MAX, "%s.so.2", libname); ptr = dlopen(filename2, RTLD_LAZY | RTLD_GLOBAL); if (!ptr) { - sprintf(filename2, "%s.so.1", libname); + snprintf(filename2, FL_PATH_MAX, "%s.so.1", libname); ptr = dlopen(filename2, RTLD_LAZY | RTLD_GLOBAL); if (!ptr) { - sprintf(filename2, "%s.so.0", libname); + snprintf(filename2, FL_PATH_MAX, "%s.so.0", libname); ptr = dlopen(filename2, RTLD_LAZY | RTLD_GLOBAL); } } @@ -219,13 +219,13 @@ void *Fl_Posix_System_Driver::dlopen_or_dlsym(const char *lib_name, const char * #ifdef __APPLE_CC__ // allows testing on Darwin + XQuartz + fink if (lib_name) { char path[FL_PATH_MAX]; - sprintf(path, "/opt/X11/lib/%s.dylib", lib_name); + snprintf(path, FL_PATH_MAX, "/opt/X11/lib/%s.dylib", lib_name); lib_address = dlopen(path, RTLD_LAZY | RTLD_GLOBAL); if (!lib_address) { - sprintf(path, "/opt/sw/lib/%s.dylib", lib_name); + snprintf(path, FL_PATH_MAX, "/opt/sw/lib/%s.dylib", lib_name); lib_address = dlopen(path, RTLD_LAZY | RTLD_GLOBAL); if (!lib_address) { - sprintf(path, "/sw/lib/%s.dylib", lib_name); + snprintf(path, FL_PATH_MAX, "/sw/lib/%s.dylib", lib_name); lib_address = dlopen(path, RTLD_LAZY | RTLD_GLOBAL); } } |
