From 40da4f33142f436e0596ef2bd44649974f38d1ee Mon Sep 17 00:00:00 2001 From: Tinny Ng <tng@apache.org> Date: Fri, 27 Sep 2002 19:25:10 +0000 Subject: [PATCH] Samples Fix: wrong length in memset git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@174257 13f79535-47bb-0310-9956-ffa450edef68 --- samples/DOMCount/DOMCount.cpp | 2 +- samples/SAX2Count/SAX2Count.cpp | 5 ++++- samples/SAXCount/SAXCount.cpp | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/samples/DOMCount/DOMCount.cpp b/samples/DOMCount/DOMCount.cpp index 7a95dcf15..8f9239ff2 100644 --- a/samples/DOMCount/DOMCount.cpp +++ b/samples/DOMCount/DOMCount.cpp @@ -284,7 +284,7 @@ int main(int argC, char* argV[]) { char fURI[1000]; //initialize the array to zeros - memset(fURI,0,sizeof(fURI)); + memset(fURI,0,strlen(fURI)); if (doList) { if (! fin.eof() ) { diff --git a/samples/SAX2Count/SAX2Count.cpp b/samples/SAX2Count/SAX2Count.cpp index 10e5722d1..80f9ddde5 100644 --- a/samples/SAX2Count/SAX2Count.cpp +++ b/samples/SAX2Count/SAX2Count.cpp @@ -56,6 +56,9 @@ /* * $Log$ +* Revision 1.19 2002/09/27 19:24:57 tng +* Samples Fix: wrong length in memset +* * Revision 1.18 2002/07/17 18:58:35 tng * samples update: for testing special encoding purpose. * @@ -318,7 +321,7 @@ int main(int argC, char* argV[]) { char fURI[1000]; //initialize the array to zeros - memset(fURI,0,sizeof(fURI)); + memset(fURI,0,strlen(fURI)); if (doList) { if (! fin.eof() ) { diff --git a/samples/SAXCount/SAXCount.cpp b/samples/SAXCount/SAXCount.cpp index 22400553f..58902728a 100644 --- a/samples/SAXCount/SAXCount.cpp +++ b/samples/SAXCount/SAXCount.cpp @@ -56,6 +56,9 @@ /* * $Log$ +* Revision 1.22 2002/09/27 19:25:10 tng +* Samples Fix: wrong length in memset +* * Revision 1.21 2002/07/17 18:58:36 tng * samples update: for testing special encoding purpose. * @@ -313,7 +316,7 @@ int main(int argC, char* argV[]) { char fURI[1000]; //initialize the array to zeros - memset(fURI,0,sizeof(fURI)); + memset(fURI,0,strlen(fURI)); if (doList) { if (! fin.eof() ) { -- GitLab