[rtems commit] Initialize the string before replacing characters

Sebastian Huber sebh at rtems.org
Mon Aug 26 07:45:45 UTC 2013


Module:    rtems
Branch:    master
Commit:    2f0d5e453b97e2d34593e00f8173635ae990a08d
Changeset: http://git.rtems.org/rtems/commit/?id=2f0d5e453b97e2d34593e00f8173635ae990a08d

Author:    Cynthia Rempel <cynthia at rtems.org>
Date:      Sun Aug 25 18:00:31 2013 -0700

Initialize the string before replacing characters

---

 tools/build/unhex.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/build/unhex.c b/tools/build/unhex.c
index 9248e8f..be4465d 100644
--- a/tools/build/unhex.c
+++ b/tools/build/unhex.c
@@ -545,6 +545,7 @@ convert_TI_records(
 
     while ( ! endrecord && (fgets(buff, sizeof(buff), ifp)))
     {
+        p = &buff[0];
         if (p[strlen(p)-1] == '\n')                 /* get rid of newline */
             p[strlen(p)-1] = '\0';
 
@@ -553,7 +554,6 @@ convert_TI_records(
 
         tb.dl_count = 0;
 
-        p = &buff[0];
         eol = FALSE;
         while ( ! eol && ! endrecord)
         {




More information about the vc mailing list