#include "standards.h" #include #include "vec.h" type_status vec_allocfit(vec_type* v) { if (v->len==0) vec_free(v); else { unsigned char* const snew=realloc(v->s, v->len); if (snew==NULL) return -1; v->s=snew; v->a=v->len; } return 0; }