...
Code Block | ||
---|---|---|
| ||
int create_table(size_t length) { char **table; if (sizeof(char *)length > SIZE_MAX/lengthsizeof(char *)) { /* handle overflow */ return -1; } size_t table_length = length * sizeof(char *); table = (char **)malloc(table_length); if (table == NULL) { /* Handle error condition */ return -1; } /* ... */ return 0; } |
...