]> git.pond.sub.org Git - empserver/commitdiff
Remove useless strncpy() in ac_encounter()
authorMarkus Armbruster <armbru@pond.sub.org>
Wed, 24 Sep 2008 23:31:15 +0000 (19:31 -0400)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 1 Feb 2009 16:14:39 +0000 (17:14 +0100)
src/lib/subs/aircombat.c

index 400ddcdbf90f211d4715d9c3329df3751b26f7be..2c6c0f7611d5f52e0f38ac70ffd3b96ce0a90ab5 100644 (file)
@@ -82,8 +82,6 @@ ac_encounter(struct emp_qelem *bomb_list, struct emp_qelem *esc_list,
     int overfly[MAXNOC];
     int flags;
     struct emp_qelem ilist[MAXNOC];
-    char mypath[1024];
-    int myp;
     int civ, mil;
     natid plane_owner;
     struct sctstr sect;
@@ -103,9 +101,6 @@ ac_encounter(struct emp_qelem *bomb_list, struct emp_qelem *esc_list,
     plp = (struct plist *)bomb_list->q_forw;
     plane_owner = plp->plane.pln_own;
 
-    strncpy(mypath, path, sizeof(mypath));
-    myp = 0;
-
     memset(overfly, 0, sizeof(overfly));
     memset(gotilist, 0, sizeof(gotilist));
     memset(unfriendly, 0, sizeof(unfriendly));
@@ -133,7 +128,7 @@ ac_encounter(struct emp_qelem *bomb_list, struct emp_qelem *esc_list,
        }
     }
 
-    while ((dir = mypath[myp++]) && !QEMPTY(bomb_list)) {
+    while ((dir = *path++) && !QEMPTY(bomb_list)) {
        if ((val = diridx(dir)) == DIR_STOP)
            break;
        /* XXX using xnorm is probably bad */