sprintf -> snprintf

This commit is contained in:
Jean-François DEL NERO
2023-02-03 22:15:44 +01:00
parent 02313b26ff
commit 057ea92615
3 changed files with 15 additions and 8 deletions
@@ -165,7 +165,7 @@ void raw_loader_window_datachanged(Fl_Widget* w, void*)
{
int totalsector,totalsize;
int temp[256],v;
char file[512];
char file[MAX_TMP_STR_SIZE];
rawfile_loader_window *rlw;
Fl_Window *dw;
HXCFE_XMLLDR* rfb;
@@ -325,7 +325,7 @@ void raw_loader_window_bt_loadrawfile(Fl_Button* bt, void*)
{
int totalsector,totalsize;
int temp[256];
char file[1024];
char file[MAX_TMP_STR_SIZE];
int disklayout;
rawfile_loader_window *rlw;
Fl_Window *dw;
@@ -422,7 +422,7 @@ void raw_loader_window_bt_createemptyfloppy(Fl_Button* bt, void*)
void raw_loader_window_bt_savecfg(Fl_Button* bt, void*)
{
FILE * fpf_file;
char file[1024];
char file[MAX_TMP_STR_SIZE];
cfgrawfile rfc;
rawfile_loader_window *rlw;
Fl_Window *dw;
@@ -448,7 +448,7 @@ void raw_loader_window_bt_savecfg(Fl_Button* bt, void*)
void raw_loader_window_bt_loadcfg(Fl_Button* bt, void*)
{
FILE * fpf_file;
char file[1024];
char file[MAX_TMP_STR_SIZE];
cfgrawfile rfc;
rawfile_loader_window *rlw;
Fl_Window *dw;
@@ -43,8 +43,11 @@
// Change History (most recent first):
///////////////////////////////////////////////////////////////////////////////////
#include "fl_includes.h"
#include "sdhxcfecfg_window.h"
#include "cb_sdhxcfecfg_window.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -385,7 +388,7 @@ void sdhxcfecfg_window_datachanged(Fl_Widget* w, void*)
void sdhxcfecfg_window_bt_load(Fl_Button* bt, void*)
{
int temp[512];
int temp[MAX_TMP_STR_SIZE];
FILE *f;
sdhxcfecfg_window *sdcfgw;
Fl_Window *dw;
@@ -409,7 +412,7 @@ void sdhxcfecfg_window_bt_load(Fl_Button* bt, void*)
void sdhxcfecfg_window_bt_save(Fl_Button* bt, void*)
{
int temp[512];
int temp[MAX_TMP_STR_SIZE];
FILE *f;
sdhxcfecfg_window *sdcfgw;
Fl_Window *dw;
@@ -43,8 +43,12 @@ int fileselector(char * title,char * str,char *filename,char *filter,int save,in
}
default:
{
str[0] = 0;
path=(char*)fnfc.filename();
sprintf(str,"%s",path);
if(path)
{
snprintf(str,MAX_TMP_STR_SIZE,"%s",path);
}
return 0;
break; // FILE CHOSEN
}
@@ -62,7 +66,7 @@ int select_dir(char * title,char * str)
fnfc.filter("\t*.*\n");
// Show native chooser
switch ( fnfc.show() )
switch ( fnfc.show() )
{
case -1:
{