From: Pasi Kallinen Date: Thu, 20 Mar 2008 17:03:17 +0000 (+0000) Subject: If we can't read from the canned rc file, don't create empty default one. X-Git-Tag: v1.6.1-roc-dev~283 X-Git-Url: https://skyeroc.xyz/gitweb/?a=commitdiff_plain;h=802018c137e2267b096502d0dce84c0606b537dd;p=dgamelaunch If we can't read from the canned rc file, don't create empty default one. git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@425 db0b04b0-f4d1-0310-9a6d-de3e77497b0e --- diff --git a/dgl-common.c b/dgl-common.c index 0e95e64..924408f 100644 --- a/dgl-common.c +++ b/dgl-common.c @@ -157,8 +157,8 @@ dgl_exec_cmdqueue(struct dg_cmdpart *queue, int game, struct dg_user *me) char buf[1024]; size_t bytes; /* FIXME: use nethack-themed error messages here, as per write_canned_rcfile() */ - if (!(newfile = fopen (p2, "w"))) break; if (!(cannedf = fopen (p1, "r"))) break; + if (!(newfile = fopen (p2, "w"))) break; while ((bytes = fread (buf, 1, 1024, cannedf)) > 0) { if (fwrite (buf, 1, bytes, newfile) != bytes) { if (ferror (newfile)) {