From f5cabb4bea00169c079bb90c95a825c76d3de57e Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 10 May 2006 04:44:07 +0000 Subject: [PATCH] fixed infinite loop (oops) --- amxmodx/libraries.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/amxmodx/libraries.cpp b/amxmodx/libraries.cpp index fc6047b2..284b2b5c 100644 --- a/amxmodx/libraries.cpp +++ b/amxmodx/libraries.cpp @@ -68,9 +68,9 @@ bool DecodeLibCmdString(const char *str, LibDecoder *dec) dec->param2 = NULL; } else { dec->buffer = strdup(str); - char *p = strchr(str, '_'); - while (p && (*(p+1) != '_')) - p = strchr(str, '_'); + char *p = strchr(dec->buffer, '_'); + while (p && (*(p+1) == '_')) + p = strchr(p+2, '_'); if (!p || !*(p+1)) return false; *p = '\0'; @@ -220,6 +220,8 @@ LibError RunLibCommand(const LibDecoder *enc) expect = LibType_Library; else if (enc->cmd == LibCmd_ExpectClass) expect = LibType_Class; + else + expect = LibType_Library; /** see if it exists */ for (; iter != end; iter++)