Is Titan submarine the most daring space mission yet?
bbc.co.uk1 pointsby ghswa0 comments
int8_t i;
/* ... */
i += 1;
if (i == 0) {
/* ... */
} int create_vector(struct vector *vc, int size) {
vc->data = 0;
vc->size = 0;
if (vc == NULL) {
return VECTOR_NULL_ERROR;
}
/* check for integer and SIZE_MAX overflow */
if (size == 0 || size > SIZE_MAX) {
errno = ENOMEM;
return VECTOR_SIZE_ERROR;
}
Accessing the fields of vc before the NULL check seems like an error. Also, would it not be simpler to change type of the size parameter to size_t so that it's the same type as the size field of the vector struct?
I also think it would be respectful to the women who died in the space programmes to edit "his life" to "their life".