FN_START;
int minute;
int second;
+ int ret;
+ char min_part[BT_BUFFER_LEN] = { 0, };
+ char sec_part[BT_BUFFER_LEN] = { 0, };
ret_if(remain_time > BT_TIMEOUT_MAX);
snprintf(text_display, size_display, "%d:%02d", minute, second);
if (size_read == BT_BUFFER_LEN && text_read != NULL) {
- char min_part[BT_BUFFER_LEN] = { 0, };
- char sec_part[BT_BUFFER_LEN] = { 0, };
/*Set minute Text*/
if (minute == 1)
snprintf(sec_part, BT_BUFFER_LEN, "%d %s",
second, BT_STR_SECONDS);
- int ret = snprintf(text_read, size_read, "%s %s", min_part, sec_part);
- if (ret < 0) {
- BT_ERR("snprintf error");
- return;
- }
+ ret = snprintf(text_read, size_read, "%s %s", min_part, sec_part);
+ if (ret < 0 || ret >= size_read)
+ BT_ERR("snprintf error: truncated or error. ret(%d)", ret);
}
FN_END;
}
#include <vconf.h>
#include <aul.h>
#include <notification.h>
-#
#include "bt-main-ug.h"
#include "bt-util.h"
#include "bt-debug.h"
FN_START;
int minute;
int second;
+ int ret;
+ char min_part[BT_BUFFER_LEN] = { 0, };
+ char sec_part[BT_BUFFER_LEN] = { 0, };
ret_if(remain_time > BT_TIMEOUT_MAX);
snprintf(text_display, size_display, "%d:%02d", minute, second);
if (size_read == BT_BUFFER_LEN && text_read != NULL) {
- char min_part[BT_BUFFER_LEN] = { 0, };
- char sec_part[BT_BUFFER_LEN] = { 0, };
/*Set minute Text*/
if (minute == 1)
snprintf(sec_part, BT_BUFFER_LEN, "%d %s",
second, BT_STR_SECONDS);
- snprintf(text_read, size_read, "%s %s", min_part, sec_part);
+ ret = snprintf(text_read, size_read, "%s %s", min_part, sec_part);
+ if (ret < 0 || ret >= size_read)
+ BT_ERR("snprintf error: truncated or error. ret(%d)", ret);
+
}
FN_END;
}