You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by sa...@apache.org on 2004/06/04 06:59:39 UTC
cvs commit: ws-axis/c/include/axis/server AxisFile.h
sanjaya 2004/06/03 21:59:39
Modified: c/include/axis/server AxisFile.h
Log:
1. Fixed bug caused by uninitialized variable
2. Stripped newlines off lines returned by the fileGet method
Revision Changes Path
1.4 +12 -2 ws-axis/c/include/axis/server/AxisFile.h
Index: AxisFile.h
===================================================================
RCS file: /home/cvs/ws-axis/c/include/axis/server/AxisFile.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- AxisFile.h 12 May 2004 07:36:46 -0000 1.3
+++ AxisFile.h 4 Jun 2004 04:59:39 -0000 1.4
@@ -18,6 +18,7 @@
#define __AXIS_AXISFILE_H_OF_AXIS_INCLUDED__
#include <axis/server/GDefine.h>
#include <stdio.h>
+#include <string.h>
/**
* @class AxisFile
@@ -43,6 +44,7 @@
*/
AxisFile()
{
+ pFILEFile = NULL;
}
/**
@@ -73,8 +75,16 @@
*/
int fileGet(char* sLine, int iBufferSize)
{
- if(fgets (sLine, iBufferSize, pFILEFile) != NULL)
- return AXIS_SUCCESS;
+ if(fgets (sLine, iBufferSize, pFILEFile) != NULL )
+ {
+ char * newline = strpbrk(sLine, "\n");
+ if(newline)
+ {
+ *newline = '\0';
+ }
+ return AXIS_SUCCESS;
+ }
+
return AXIS_FAIL;
}