-void *xmalloc(size_t s) {
- void *p;
- p= malloc(s?s:1); if (!p) syscallerror("malloc");
- return p;
-}
-
-void *xrealloc(void *p, size_t s) {
- p= realloc(p,s); if (!p) syscallerror("realloc");
- return p;
-}
-
-char *xstrdup(const char *str) {
- char *r;
- r= xmalloc(strlen(str)+1);
- strcpy(r,str); return r;
-}
-
-void makeroom(char **buffer, int *size, int needed) {
- if (*size >= needed) return;
+int makeroom(char **buffer, int *size, int needed) {
+ if (needed > MAX_GENERAL_STRING) return -1;
+ if (*size >= needed) return 0;