chiark / gitweb /
www-cgi/: Move `xrealloc' to `ucgicommon'.
[userv-utils.git] / www-cgi / ucgitarget.c
index eb5fdabaface49339b75ab43852341b84f5e9da4..e38ad3050aef312c72b2c6dc56cdceb95505ef25 100644 (file)
 
 #include "ucgi.h"
 
-static void *xrealloc(void *ptr, size_t sz) {
-  void *r;
-
-  r= realloc(ptr,sz);
-  if (!r) syserror("realloc failed");
-  return r;
-}
-
 int main(int argc, const char **argv) {
   char *uservarn, *scriptpath, *newvar;
   const char *nextslash, *lastslash, *pathi, *ev, *ev2, *en, *scriptdir, *av;
@@ -94,7 +86,7 @@ int main(int argc, const char **argv) {
     if (scriptpath[scriptpathlen-1]=='~') error("bad char end");
     r= stat(scriptpath,&stab); if (r) syserror("stat script");
     if (S_ISREG(stab.st_mode)) break;
-    if (!S_ISDIR(stab.st_mode)) syserror("script not directory or file");
+    if (!S_ISDIR(stab.st_mode)) error("script not directory or file");
     lastslash= nextslash;
   }
   if (*nextslash) xsetenv("PATH_INFO",nextslash,1);