Fossil SCM

Avoid a valgrind warning in the side-by-side diff logic.

drh 2012-03-19 11:58 trunk
Commit 9262546e4381bed65312dad0de503fff9a194898
1 file changed +1
+1
--- src/diff.c
+++ src/diff.c
@@ -881,10 +881,11 @@
881881
int m, ma, mb;/* Number of lines to output */
882882
int skip; /* Number of lines to skip */
883883
int nChunk = 0; /* Number of chunks of diff output seen so far */
884884
SbsLine s; /* Output line buffer */
885885
886
+ memset(&s, 0, sizeof(s));
886887
s.zLine = fossil_malloc( 10*width + 200 );
887888
if( s.zLine==0 ) return;
888889
s.width = width;
889890
s.escHtml = escHtml;
890891
s.iStart = -1;
891892
--- src/diff.c
+++ src/diff.c
@@ -881,10 +881,11 @@
881 int m, ma, mb;/* Number of lines to output */
882 int skip; /* Number of lines to skip */
883 int nChunk = 0; /* Number of chunks of diff output seen so far */
884 SbsLine s; /* Output line buffer */
885
 
886 s.zLine = fossil_malloc( 10*width + 200 );
887 if( s.zLine==0 ) return;
888 s.width = width;
889 s.escHtml = escHtml;
890 s.iStart = -1;
891
--- src/diff.c
+++ src/diff.c
@@ -881,10 +881,11 @@
881 int m, ma, mb;/* Number of lines to output */
882 int skip; /* Number of lines to skip */
883 int nChunk = 0; /* Number of chunks of diff output seen so far */
884 SbsLine s; /* Output line buffer */
885
886 memset(&s, 0, sizeof(s));
887 s.zLine = fossil_malloc( 10*width + 200 );
888 if( s.zLine==0 ) return;
889 s.width = width;
890 s.escHtml = escHtml;
891 s.iStart = -1;
892

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button