From 9321dda2811afc81277bd4b07384b1e69c16b667 Mon Sep 17 00:00:00 2001 From: carlo-bramini Date: Sun, 15 Oct 2017 18:42:44 +0200 Subject: [PATCH] Use FLUID_SNPRINTF into all remaining files --- src/bindings/fluid_cmd.c | 12 ++++++------ src/bindings/fluid_ladspa.c | 4 ++-- src/drivers/fluid_alsa.c | 12 ++++++------ src/drivers/fluid_coremidi.c | 4 ++-- src/drivers/fluid_jack.c | 2 +- src/synth/fluid_synth.c | 2 +- src/utils/fluid_sys.c | 2 +- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/bindings/fluid_cmd.c b/src/bindings/fluid_cmd.c index 698f9403..4128f76f 100644 --- a/src/bindings/fluid_cmd.c +++ b/src/bindings/fluid_cmd.c @@ -393,7 +393,7 @@ fluid_get_userconf(char* buf, int len) if (home == NULL) { return NULL; } else { - snprintf(buf, len, "%s/.fluidsynth", home); + FLUID_SNPRINTF (buf, len, "%s/.fluidsynth", home); return buf; } #endif @@ -411,7 +411,7 @@ fluid_get_sysconf(char* buf, int len) #if defined(WIN32) || defined(MACOS9) return NULL; #else - snprintf(buf, len, "/etc/fluidsynth.conf"); + FLUID_SNPRINTF (buf, len, "/etc/fluidsynth.conf"); return buf; #endif } @@ -1845,17 +1845,17 @@ char* fluid_expand_path(char* path, char* new_path, int len) { #if defined(WIN32) || defined(MACOS9) - snprintf(new_path, len - 1, "%s", path); + FLUID_SNPRINTF (new_path, len - 1, "%s", path); #else if ((path[0] == '~') && (path[1] == '/')) { char* home = getenv("HOME"); if (home == NULL) { - snprintf(new_path, len - 1, "%s", path); + FLUID_SNPRINTF (new_path, len - 1, "%s", path); } else { - snprintf(new_path, len - 1, "%s%s", home, &path[1]); + FLUID_SNPRINTF (new_path, len - 1, "%s%s", home, &path[1]); } } else { - snprintf(new_path, len - 1, "%s", path); + FLUID_SNPRINTF (new_path, len - 1, "%s", path); } #endif diff --git a/src/bindings/fluid_ladspa.c b/src/bindings/fluid_ladspa.c index 89b9ae6e..f99966a1 100644 --- a/src/bindings/fluid_ladspa.c +++ b/src/bindings/fluid_ladspa.c @@ -309,10 +309,10 @@ fluid_LADSPA_handle_start(fluid_synth_t* synth, int ac, char** av, fluid_ostream fluid_LADSPA_clear(FxUnit); return(PrintErrorMessage); }; /* if no LADSPA_PATH */ - snprintf(LibFullPath,FLUID_LADSPA_MaxPathLength,"%s/%s",LADSPA_Path,LibraryFilename); + FLUID_SNPRINTF (LibFullPath,FLUID_LADSPA_MaxPathLength,"%s/%s",LADSPA_Path,LibraryFilename); /* If no slash in filename */ } else { - snprintf(LibFullPath,FLUID_LADSPA_MaxPathLength,"%s",LibraryFilename); + FLUID_SNPRINTF (LibFullPath,FLUID_LADSPA_MaxPathLength,"%s",LibraryFilename); }; L(fluid_ostream_printf(out,"Full Library path name: %s",LibFullPath)); diff --git a/src/drivers/fluid_alsa.c b/src/drivers/fluid_alsa.c index 35c2f511..dce95158 100644 --- a/src/drivers/fluid_alsa.c +++ b/src/drivers/fluid_alsa.c @@ -726,12 +726,12 @@ static char* fluid_alsa_seq_full_id(char* id, char* buf, int len) { if (id != NULL) { if (FLUID_STRCMP(id, "pid") == 0) { - snprintf(buf, len, "FLUID Synth (%d)", getpid()); + FLUID_SNPRINTF (buf, len, "FLUID Synth (%d)", getpid()); } else { - snprintf(buf, len, "FLUID Synth (%s)", id); + FLUID_SNPRINTF (buf, len, "FLUID Synth (%s)", id); } } else { - snprintf(buf, len, "FLUID Synth"); + FLUID_SNPRINTF (buf, len, "FLUID Synth"); } return buf; @@ -741,12 +741,12 @@ static char* fluid_alsa_seq_full_name(char* id, int port, char* buf, int len) { if (id != NULL) { if (FLUID_STRCMP(id, "pid") == 0) { - snprintf(buf, len, "Synth input port (%d:%d)", getpid(), port); + FLUID_SNPRINTF (buf, len, "Synth input port (%d:%d)", getpid(), port); } else { - snprintf(buf, len, "Synth input port (%s:%d)", id, port); + FLUID_SNPRINTF (buf, len, "Synth input port (%s:%d)", id, port); } } else { - snprintf(buf, len, "Synth input port"); + FLUID_SNPRINTF (buf, len, "Synth input port"); } return buf; } diff --git a/src/drivers/fluid_coremidi.c b/src/drivers/fluid_coremidi.c index f85eb80d..0c1b1022 100644 --- a/src/drivers/fluid_coremidi.c +++ b/src/drivers/fluid_coremidi.c @@ -112,9 +112,9 @@ new_fluid_coremidi_driver(fluid_settings_t* settings, handle_midi_event_func_t h memset (clientid, 0, sizeof(clientid)); if (id != NULL) { if (FLUID_STRCMP (id, "pid") == 0) { - snprintf (clientid, sizeof(clientid), " (%d)", getpid()); + FLUID_SNPRINTF (clientid, sizeof(clientid), " (%d)", getpid()); } else { - snprintf (clientid, sizeof(clientid), " (%s)", id); + FLUID_SNPRINTF (clientid, sizeof(clientid), " (%s)", id); } FLUID_FREE (id); /* -- free id string */ } diff --git a/src/drivers/fluid_jack.c b/src/drivers/fluid_jack.c index 51f63a96..f9fd5e04 100644 --- a/src/drivers/fluid_jack.c +++ b/src/drivers/fluid_jack.c @@ -171,7 +171,7 @@ new_fluid_jack_client (fluid_settings_t *settings, int isaudio, void *driver) : "midi.jack.id", &client_name); if (client_name != NULL && client_name[0] != 0) - snprintf(name, 64, "%s", client_name); + FLUID_SNPRINTF (name, 64, "%s", client_name); else strcpy (name, "fluidsynth"); name[63] = '\0'; diff --git a/src/synth/fluid_synth.c b/src/synth/fluid_synth.c index 2cf97cd2..c2508389 100644 --- a/src/synth/fluid_synth.c +++ b/src/synth/fluid_synth.c @@ -4946,7 +4946,7 @@ fluid_synth_tuning_dump(fluid_synth_t* synth, int bank, int prog, { if (name) { - snprintf (name, len - 1, "%s", fluid_tuning_get_name (tuning)); + FLUID_SNPRINTF (name, len - 1, "%s", fluid_tuning_get_name (tuning)); name[len - 1] = 0; /* make sure the string is null terminated */ } diff --git a/src/utils/fluid_sys.c b/src/utils/fluid_sys.c index f55fa1f7..690915cd 100644 --- a/src/utils/fluid_sys.c +++ b/src/utils/fluid_sys.c @@ -834,7 +834,7 @@ fluid_istream_readline (fluid_istream_t in, fluid_ostream_t out, char* prompt, if (line == NULL) return -1; - snprintf(buf, len, "%s", line); + FLUID_SNPRINTF (buf, len, "%s", line); buf[len - 1] = 0; free(line);