Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Only clear characters that were written

  • Loading branch information...
commit 41d91b0076b8d430f064ed895efbcb9a5b840d2e 1 parent 4950e52
moetunes authored July 29, 2012

Showing 1 changed file with 4 additions and 5 deletions. Show diff stats Hide diff stats

  1. 9  splitter_bar.c
9  splitter_bar.c
@@ -157,7 +157,6 @@ void update_output() {
157 157
         win_name[count] = output[n];
158 158
         count++;
159 159
     }
160  
-    win_name[count+1] = '\0';
161 160
     new_length = wc_size(win_name, count);
162 161
     XFillRectangle(dis, winbar, theme[0].gc, 0, 0, old_length, height);
163 162
     for(count=0;count<=text_length;count++) {
@@ -256,8 +255,8 @@ void print_right_text() {
256 255
     else
257 256
         XDrawString(dis, winbar, theme[j].gc, text_start+m, font.fh, bstring, n);
258 257
     m += wsize;
259  
-    for(n=0;n<256;n++)
260  
-        bstring[n] = '\0';
  258
+    for(wsize=0;wsize<n;wsize++)
  259
+        bstring[wsize] = '\0';
261 260
     counted--;
262 261
 }
263 262
 
@@ -291,8 +290,8 @@ void print_text() {
291 290
     else
292 291
         XDrawString(dis, winbar, theme[j].gc, k, font.fh, astring, n);
293 292
     k += wsize;
294  
-    for(n=0;n<256;n++)
295  
-        astring[n] = '\0';
  293
+    for(wsize=0;wsize<n;wsize++)
  294
+        astring[wsize] = '\0';
296 295
     count--;
297 296
 }
298 297
 

0 notes on commit 41d91b0

Please sign in to comment.
Something went wrong with that request. Please try again.