an uninitialised pointer (and crashing).
Fixes: #54
--- /dev/null
+#ifndef LIB_H
+#define LIB_H
+
+extern void error(int index);
+extern char* salloc(unsigned length);
+extern void sfree(char* c);
+
+#endif
+
#include <stdlib.h>
#include <string.h>
#include "bc_string.h"
+#include "lib.h"
/* $Id$ */
if (X == 0) \
return (0);
-extern char* salloc();
-
int _length(String* str)
{
okr(str);
/* printf("mid fcn called %d %d %s\n",i1,i2,s->strval);*/
if (i2 < 0 || i1 < -1)
- return (s2); /* or error? */
+ error(3);
if (i1 == -1)
i1 = s->strlength;
s2 = _newstr(s->strval);