Replace sprintf with snprintf

This commit is contained in:
Zhenhua Zhang 2010-02-09 22:59:28 +08:00 committed by Denis Kenzior
parent d80bba564e
commit c5f962cb18
1 changed files with 3 additions and 2 deletions

View File

@ -116,9 +116,10 @@ static void g_at_server_send_result(GAtServer *server, GAtServerResult result)
return;
if (v250.is_v1)
sprintf(buf, "%c%c%s%c%c", t, r, result_str, t, r);
snprintf(buf, sizeof(buf), "%c%c%s%c%c", t, r, result_str,
t, r);
else
sprintf(buf, "%u%c", (unsigned int) result, t);
snprintf(buf, sizeof(buf), "%u%c", (unsigned int) result, t);
g_at_util_debug_chat(FALSE, buf, strlen(buf),
server->debugf, server->debug_data);