]> git.pond.sub.org Git - empserver/blobdiff - src/lib/common/stmtch.c
Update copyright notice
[empserver] / src / lib / common / stmtch.c
index 9b1074e046a9ec020a523afea6cc41b44bb06df8..351adb38b7e570d2d51ce56a0f77fc2f358c8126 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2011, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2013, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                Ken Stevens, Steve McClure, Markus Armbruster
  *
  *  Empire is free software: you can redistribute it and/or modify
@@ -40,6 +40,7 @@
  * several.
  * Each array element has a pointer to its name stored at offset OFFS.
  * Search stops when this name is a null pointer.
+ * It ignores elements with an empty name.
  * NEEDLE is compared to element names with mineq(NEEDLE, NAME).
  * SIZE gives the size of an array element.
  */
@@ -54,6 +55,8 @@ stmtch(char *needle, void *haystack, ptrdiff_t offs, size_t size)
        name = *(char **)((char *)haystack + i * size + offs);
        if (!name)
            break;
+       if (!*name)
+           continue;
        switch (mineq(needle, name)) {
        case ME_MISMATCH:
            break;