diff --git a/lang/basic/lib/lib.h b/lang/basic/lib/lib.h new file mode 100644 index 000000000..8dc371c91 --- /dev/null +++ b/lang/basic/lib/lib.h @@ -0,0 +1,9 @@ +#ifndef LIB_H +#define LIB_H + +extern void error(int index); +extern char* salloc(unsigned length); +extern void sfree(char* c); + +#endif + diff --git a/lang/basic/lib/string.c b/lang/basic/lib/string.c index 4c3d7a390..c4cdbe117 100644 --- a/lang/basic/lib/string.c +++ b/lang/basic/lib/string.c @@ -1,6 +1,7 @@ #include #include #include "bc_string.h" +#include "lib.h" /* $Id$ */ @@ -11,8 +12,6 @@ if (X == 0) \ return (0); -extern char* salloc(); - int _length(String* str) { okr(str); @@ -158,7 +157,7 @@ String* _mid(int i1, int i2, String* s) /* 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);