Use FLUID_SNPRINTF into all remaining files

This commit is contained in:
carlo-bramini 2017-10-15 18:42:44 +02:00
parent 1c0419c4c3
commit 9321dda281
7 changed files with 19 additions and 19 deletions

View file

@ -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

View file

@ -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));

View file

@ -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;
}

View file

@ -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 */
}

View file

@ -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';

View file

@ -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 */
}

View file

@ -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);