- Fix for Nek's last fix :) Do not enter the loop if NumArgs is zero.

It would loop forever.
- Also strcasestr() is a gnu extension, we need the proper define so that
the prototype is accessable.


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@163 119443c7-1b9e-41f8-b6fc-b9c35fce742c
This commit is contained in:
Marcelo Roberto Jimenez 2007-04-26 11:40:34 +00:00
parent e04192e1d0
commit e80cc3ac64
2 changed files with 5 additions and 6 deletions

View File

@ -259,7 +259,7 @@ makeAction( IN int response,
const char *ArgName;
const char *ArgValue;
char *ActBuff;
int Idx = 0;
int Idx;
IXML_Document *ActionDoc;
IXML_Node *node;
IXML_Element *Ele;
@ -298,7 +298,7 @@ makeAction( IN int response,
if( NumArg > 0 ) {
//va_start(ArgList, Arg);
ArgName = Arg;
for(;;) {
for(Idx = 0; Idx < NumArg; ++Idx) {
ArgValue = va_arg( ArgList, const char * );
if( ArgName != NULL ) {
@ -313,11 +313,9 @@ makeAction( IN int response,
ixmlNode_appendChild( node, ( IXML_Node * ) Ele );
}
if ( ++Idx == NumArg ) {
break;
if ( Idx != NumArg - 1) {
ArgName = va_arg( ArgList, const char * );
}
ArgName = va_arg( ArgList, const char * );
}
//va_end(ArgList);
}

View File

@ -34,6 +34,7 @@
* messages.
************************************************************************/
#define _GNU_SOURCE // For strcasestr() in string.h
#include "config.h"
#include <assert.h>
#include <string.h>