diff -u -r lpe-1.2.6.11/src/buffer.c lpe-new/src/buffer.c
--- lpe-1.2.6.11/src/buffer.c	2004-07-24 01:00:26.000000000 +0200
+++ lpe-new/src/buffer.c	2005-09-23 01:42:06.000000000 +0200
@@ -550,7 +550,9 @@
      */
     strcpy(dir, buf->fname);
     strcpy(file,buf->fname);
-    sprintf(bakname,"%s/.%s.lpe",dirname(dir),basename(file));
+    if ((buf->fname) != NULL) {
+       snprintf(bakname, sizeof(bakname), "%s.lpe", file);
+    }
     if(copy(buf->fname,bakname) != 0)
         copied = 0;
     fp = fopen (buf->fname, "w");
