[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ipcop-svn
Subject:    [Ipcop-svn] SF.net SVN: ipcop: [585]
From:       owes () users ! sourceforge ! net
Date:       2007-10-29 8:29:57
Message-ID: E1ImQ0T-0001px-14 () sc8-pr-svn4 ! sourceforge ! net
[Download RAW message or body]

Revision: 585
          http://ipcop.svn.sourceforge.net/ipcop/?rev=585&view=rev
Author:   owes
Date:     2007-10-29 01:29:56 -0700 (Mon, 29 Oct 2007)

Log Message:
-----------
fix free_kv
make mysystem test for flog

Modified Paths:
--------------
    ipcop/trunk/src/installer/helper.c

Modified: ipcop/trunk/src/installer/helper.c
===================================================================
--- ipcop/trunk/src/installer/helper.c	2007-10-29 01:59:42 UTC (rev 584)
+++ ipcop/trunk/src/installer/helper.c	2007-10-29 08:29:56 UTC (rev 585)
@@ -55,7 +55,10 @@
 #else
   snprintf(mycommand, STRING_SIZE, "%s >> /dev/tty6", command);
 #endif
-  fprintf(flog, "Running command: %s\n", command);
+  if ( flog != NULL )
+  {
+    fprintf(flog, "Running command: %s\n", command);
+  }
   return system(mycommand);
 }
 
@@ -133,6 +136,7 @@
 	{
     if (strcmp(p->item.key, key) == 0)
 		  return p->item.value;
+
 	  p = p->next;
 	}
 	return NULL;
@@ -233,13 +237,13 @@
 
   while ( cur )
   {
-		if ( !strchr(cur->item.value, ' ') )
+		if ( strchr(cur->item.value, ' ') != NULL )
     {
-      fprintf(file, "%s=\'%s\'", cur->item.key, cur->item.value);
+      fprintf(file, "%s=\'%s\'\n", cur->item.key, cur->item.value);
     }
     else
     {
-      fprintf(file, "%s=%s", cur->item.key, cur->item.value);
+      fprintf(file, "%s=%s\n", cur->item.key, cur->item.value);
     }
     cur = cur->next;
   }
@@ -255,15 +259,15 @@
 void free_kv (NODEKV **p)
 {
 	NODEKV *b = *p;
-	while (b)
+	while ( b )
 	{
-	    free(b->item.key);
-	    free(b->item.value);
-	    NODEKV *deleted=*p;
-	    b = b->next;
-	    free (deleted);
+    free(b->item.key);
+    free(b->item.value);
+    NODEKV *deleted = b;
+    b = b->next;
+    free(deleted);
 	}
-	*p=NULL;
+	*p = NULL;
 }
 
 /* Fill the 'keyvalue list with result of parsing a text line


This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Ipcop-svn mailing list
Ipcop-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipcop-svn


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic