INCLUDE(FindPkgConfig)
-SET(EXTRA_CFLAGS "-Wall -Werror-implicit-function-declaration -fvisibility=hidden ")
+SET(EXTRA_CFLAGS "-Wall -Werror-implicit-function-declaration -fvisibility=hidden -Wno-int-conversion -Wno-bool-operation -Wno-unused-result -Wno-misleading-indentation -Wno-unused-variable")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS}")
static void _cal_server_alarm_get_latest(time_t utime, bool get_all, GList **out_l)
{
+ int ret = 0;
CAL_FN_CALL();
RET_IF(NULL == out_l);
localtime_r(&utime, &st_local);
char datetime[CAL_STR_SHORT_LEN32] = {0};
- snprintf(datetime, sizeof(datetime), CAL_FORMAT_LOCAL_DATETIME,
+ ret = snprintf(datetime, sizeof(datetime), CAL_FORMAT_LOCAL_DATETIME,
st_local.tm_year +1900, st_local.tm_mon + 1, st_local.tm_mday,
st_local.tm_hour, st_local.tm_min, st_local.tm_sec);
+
+ if(ret < 0){
+ WARN("datetime is truncated (%s)",datetime);
+ }
+
DBG("get alert to register with given time (%ld) datetime[%s]", utime, datetime);
GList *l = NULL;
static int _cal_server_contacts_set_new_event(int id, char *label, int calendar_type,
int date, char *type_str, int account_id, calendar_record_h *out_event)
{
- int ret;
+ int ret, wrn = 0;
char buf[4] = {0};
calendar_record_h event = NULL;
calendar_time_s st = {0};
}
if (0 < account_id) {
- snprintf(buf, sizeof(buf), "%d", account_id);
+ wrn = snprintf(buf, sizeof(buf), "%d", account_id);
+ if(wrn < 0){
+ WARN("buf text is truncated (%s)",buf);
+ }
ret = calendar_record_set_str(event, _calendar_event.sync_data4, buf);
if (CALENDAR_ERROR_NONE != ret) {
/* LCOV_EXCL_START */
char offsetquery[CAL_DB_SQL_MAX_LEN] = {0};
char limitquery[CAL_DB_SQL_MAX_LEN] = {0};
sqlite3_stmt *stmt = NULL;
+ int wrn = 0;
RETV_IF(NULL == out_list, CALENDAR_ERROR_INVALID_PARAMETER);
if (0 < limit)
snprintf(limitquery, sizeof(limitquery), "LIMIT %d", limit);
- snprintf(query, sizeof(query), "SELECT *, rowid FROM %s %s %s",
+ wrn = snprintf(query, sizeof(query), "SELECT *, rowid FROM %s %s %s",
CAL_TABLE_ALARM, limitquery, offsetquery);
+ if(wrn < 0){
+ WARN("query is truncated (%s)",query);
+ }
+
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
/* LCOV_EXCL_START */
char offsetquery[CAL_DB_SQL_MAX_LEN] = {0};
char limitquery[CAL_DB_SQL_MAX_LEN] = {0};
sqlite3_stmt *stmt = NULL;
+ int wrn = 0;
RETV_IF(NULL == out_list, CALENDAR_ERROR_INVALID_PARAMETER);
if (0 < offset)
snprintf(offsetquery, sizeof(offsetquery), "OFFSET %d ", offset);
- snprintf(query, sizeof(query), "SELECT *, rowid FROM %s %s %s ",
+ wrn = snprintf(query, sizeof(query), "SELECT *, rowid FROM %s %s %s ",
CAL_TABLE_ATTENDEE, limitquery, offsetquery);
+ if(wrn < 0){
+ WARN("query is truncated (%s)",query);
+ }
+
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
/* LCOV_EXCL_START */
static int __get_time_shifted_field(char *old_field, int old_type, int new_type, time_t time_diff, char **new_field)
{
+ int ret = 0;
if (NULL == old_field || '\0' == *old_field)
return CALENDAR_ERROR_NONE;
case 15: /* YYYYMMDDTHHMMSS */
tt = timelocal(&tm) - time_diff;
gmtime_r(&tt, &tm);
- snprintf(buf, sizeof(buf), "%s"CAL_DATETIME_FORMAT_YYYYMMDDTHHMMSSZ,
+ ret = snprintf(buf, sizeof(buf), "%s"CAL_DATETIME_FORMAT_YYYYMMDDTHHMMSSZ,
i == 0 ? "" : ",", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
tm.tm_hour, tm.tm_min, tm.tm_sec);
break;
case 16: /* YYYYMMDDTHHMMSSZ */
tt = timegm(&tm) - time_diff;
gmtime_r(&tt, &tm);
- snprintf(buf, sizeof(buf), "%s"CAL_DATETIME_FORMAT_YYYYMMDDTHHMMSSZ,
+ ret = snprintf(buf, sizeof(buf), "%s"CAL_DATETIME_FORMAT_YYYYMMDDTHHMMSSZ,
i == 0 ? "" : ",", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
tm.tm_hour, tm.tm_min, tm.tm_sec);
break;
case 15: /* YYYYMMDDTHHMMSS */
tt = timegm(&tm) - time_diff;
gmtime_r(&tt, &tm);
- snprintf(buf, sizeof(buf), "%s"CAL_DATETIME_FORMAT_YYYYMMDDTHHMMSS,
+ ret = snprintf(buf, sizeof(buf), "%s"CAL_DATETIME_FORMAT_YYYYMMDDTHHMMSS,
i == 0 ? "" : ",", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
tm.tm_hour, tm.tm_min, tm.tm_sec);
break;
case 16: /* YYYYMMDDTHHMMSSZ */
tt = timegm(&tm) - time_diff;
localtime_r(&tt, &tm);
- snprintf(buf, sizeof(buf), "%s"CAL_DATETIME_FORMAT_YYYYMMDDTHHMMSSZ,
+ ret = snprintf(buf, sizeof(buf), "%s"CAL_DATETIME_FORMAT_YYYYMMDDTHHMMSSZ,
i == 0 ? "" : ",", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
tm.tm_hour, tm.tm_min, tm.tm_sec);
break;
}
break;
}
+
+ if(ret < 0){
+ WARN("text is truncated (%s)", buf);
+ }
+
len += snprintf(field + len, len_field -len, "%s", buf);
DBG("[%s]", field);
}
char offsetquery[CAL_DB_SQL_MAX_LEN] = {0};
char limitquery[CAL_DB_SQL_MAX_LEN] = {0};
sqlite3_stmt *stmt = NULL;
+ int wrn = 0;
RETV_IF(NULL == out_list, CALENDAR_ERROR_INVALID_PARAMETER);
if (0 < limit)
snprintf(limitquery, sizeof(limitquery), "LIMIT %d", limit);
- snprintf(query, sizeof(query), "SELECT * FROM %s %s %s", CAL_TABLE_EXTENDED, limitquery, offsetquery);
+ wrn = snprintf(query, sizeof(query), "SELECT * FROM %s %s %s", CAL_TABLE_EXTENDED, limitquery, offsetquery);
+
+ if(wrn < 0){
+ WARN("query is truncated (%s)",query);
+ }
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
char offsetquery[CAL_DB_SQL_MAX_LEN] = {0};
char limitquery[CAL_DB_SQL_MAX_LEN] = {0};
sqlite3_stmt *stmt = NULL;
+ int wrn = 0;
RETV_IF(NULL == out_list, CALENDAR_ERROR_INVALID_PARAMETER);
if (0 < limit)
snprintf(limitquery, sizeof(limitquery), "LIMIT %d", limit);
- snprintf(query, sizeof(query), "SELECT * FROM %s where "
+ wrn = snprintf(query, sizeof(query), "SELECT * FROM %s where "
"calendar_id IN (select id from %s where deleted = 0) "
"%s %s",
CAL_TABLE_TIMEZONE,
limitquery,
offsetquery);
+ if(wrn < 0){
+ WARN("query is truncated (%s)",query);
+ }
+
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
/* LCOV_EXCL_START */