Commits

Shlomi Fish  committed ffbd2c9

More GNUCC/GCC warnings silencing.

  • Participants
  • Parent commits c7d7268

Comments (0)

Files changed (2)

File src/wml_backend/p3_eperl/eperl_perl5.c

     if (!keepcwd) {
         /* if running as a Unix filter remember the cwd for outputfile */
         if (mode == MODE_FILTER)
-            getcwd(cwd, MAXPATHLEN);
+        {
+            if (! getcwd(cwd, MAXPATHLEN))
+            {
+                CU(-1);
+            }
+        }
         /* determine dir of source file and switch to it */
         strncpy(sourcedir, source, sizeof(sourcedir));
         sourcedir[sizeof(sourcedir)-1] = NUL;
         for (cp = sourcedir+strlen(sourcedir); cp > sourcedir && *cp != '/'; cp--)
             ;
         *cp = NUL;
-        chdir(sourcedir);
+        if (chdir(sourcedir) != 0) {
+            CU(-1);
+        }
     }
 
     /*  Set the previously remembered Perl 5 scalars (option -d) */

File src/wml_backend/p3_eperl/eperl_sys.c

         return path;
     else {
         /* remember current working dir */
-        getcwd(cwd, MAXPATHLEN);
+        if (! getcwd(cwd, MAXPATHLEN)) {
+            return NULL;
+        }
         /* determine dir of path */
         cp = dirname(path);
-        chdir(cp);
-        getcwd(apath, MAXPATHLEN);
+        if (chdir(cp) != 0) {
+            return NULL;
+        }
+        if (! getcwd(apath, MAXPATHLEN)) {
+            return NULL;
+        }
         /* restore cwd */
-        chdir(cwd);
+        if (chdir(cwd) != 0) {
+            return NULL;
+        }
         /* add file part again */
         if (apath[strlen(apath)-1] != '/') {
             strncpy(apath+strlen(apath), "/", sizeof(apath)-strlen(apath));