]> diplodocus.org Git - nmh/blobdiff - uip/annosbr.c
Replace getcpy() with mh_xstrdup() where the string isn't NULL.
[nmh] / uip / annosbr.c
index 63d2ee4487a106010b25bde0b25b0f43fa4730bd..a763746dd6066cb329e8ab0237c698f07414e6c8 100644 (file)
@@ -395,10 +395,8 @@ annosbr (int fd, char *file, char *comp, char *text, int inplace, int datesw, in
      * copying routine uses the descriptor, not the pointer.
      */
 
-    if (append || delete >= -1) {
-       if (lseek(fd, (off_t)ftell(fp), SEEK_SET) == (off_t)-1)
-           adios(NULL, "can't seek.");
-    }
+    if (fp && lseek(fd, (off_t)ftell(fp), SEEK_SET) == (off_t)-1)
+        adios(NULL, "can't seek.");
 
     cpydata (fd, fileno (tmp), file, tmpfil);
     fclose (tmp);
@@ -446,7 +444,7 @@ annosbr (int fd, char *file, char *comp, char *text, int inplace, int datesw, in
      * lkclose() fail, but that failure is ignored so it's not a problem.
      */
 
-    if (delete >= -1)
+    if (fp)
        (void)fclose(fp);
 
     return 0;