use switch_snprintf instead of snprintf becuase in insures null termination of strings.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6707 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris committed 2007-12-12 21:53:32 +00:00
1 parent 44636d333f
commit 54ec86f6ce
49 files changed
+306 -306

No files matched your search

+2 -2
View File
@@ -94,7 +94,7 @@ SWITCH_DECLARE_NONSTD(switch_status_t) switch_console_stream_write(switch_stream
ret = -1;
} else {
ret = 0;
snprintf(end, remaining, "%s", data);
switch_snprintf(end, remaining, "%s", data);
handle->data_len = strlen(buf);
handle->end = (uint8_t *) (handle->data) + handle->data_len;
}
@@ -204,7 +204,7 @@ static char prompt_str[512] = "";
char * prompt(EditLine *e) {
if (*prompt_str == '\0') {
gethostname(hostname, sizeof(hostname));
snprintf(prompt_str, sizeof(prompt_str), "freeswitch@%s> ", hostname);
switch_snprintf(prompt_str, sizeof(prompt_str), "freeswitch@%s> ", hostname);
}
return prompt_str;