#define GET_MODULE_MINOR_VERSION(vers) (((vers) >> 16) & 0xFF)
#define GET_MODULE_PATCHLEVEL(vers) ((vers) & 0xFFFF)
+#define MAX_SIZE_N(dest) (sizeof(dest) - strlen(dest) - 1)
+
/* check condition */
#define TBM_BUFMGR_RETURN_IF_FAIL(cond) {\
if (!(cond)) {\
if (!LIST_IS_EMPTY(&bufmgr->debug_key_list)) {
LIST_FOR_EACH_ENTRY(debug_old_data, &bufmgr->debug_key_list, item_link) {
- strncat(title, " ", 3);
- strncat(title, debug_old_data->key, strlen(debug_old_data->key) + 1);
+ strncat(title, " ", MAX_SIZE_N(title));
+ strncat(title, debug_old_data->key, MAX_SIZE_N(title));
}
}
LIST_FOR_EACH_ENTRY(debug_old_data, &bufmgr->debug_key_list, item_link) {
char *value;
- strncat(data, " ", 3);
+ strncat(data, " ", MAX_SIZE_N(title));
value = _tbm_surface_internal_get_debug_data(surf, debug_old_data->key);
if (value)
- strncat(data, value, strlen(value) + 1);
+ strncat(data, value, MAX_SIZE_N(title));
else
- strncat(data, "none", 5);
+ strncat(data, "none", MAX_SIZE_N(title));
}
}
TBM_SNPRINTF(str, len, "%s\n", data);