Fix segfault on really wide screens, #176052
authorArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 17:00:32 +0000 (17:00 +0000)
committerArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 17:00:32 +0000 (17:00 +0000)
Author: jgg
Date: 2003-02-02 22:24:11 GMT
Fix segfault on really wide screens, #176052

cmdline/acqprogress.cc
cmdline/acqprogress.h

index ee83392..558558a 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: acqprogress.cc,v 1.22 2001/05/27 04:46:43 jgg Exp $
+// $Id: acqprogress.cc,v 1.23 2003/02/02 22:24:11 jgg Exp $
 /* ######################################################################
 
    Acquire Progress - Command line progress meter 
@@ -152,7 +152,7 @@ bool AcqTextStatus::Pulse(pkgAcquire *Owner)
    
    enum {Long = 0,Medium,Short} Mode = Long;
    
-   char Buffer[1024];
+   char Buffer[sizeof(BlankLine)];
    char *End = Buffer + sizeof(Buffer);
    char *S = Buffer;
    if (ScreenWidth >= sizeof(Buffer))
index 8b8da04..48f90ae 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: acqprogress.h,v 1.4 1999/06/13 05:06:40 jgg Exp $
+// $Id: acqprogress.h,v 1.5 2003/02/02 22:24:11 jgg Exp $
 /* ######################################################################
 
    Acquire Progress - Command line progress meter 
@@ -15,7 +15,7 @@
 class AcqTextStatus : public pkgAcquireStatus
 {
    unsigned int &ScreenWidth;
-   char BlankLine[300];
+   char BlankLine[1024];
    unsigned long ID;
    unsigned long Quiet;