f6883df
diff --git a/list.c b/list.c
f6883df
index f7359c3..4c3d703 100644
f6883df
--- a/list.c
f6883df
+++ b/list.c
f6883df
@@ -97,7 +97,7 @@ int list_files(__G)    /* return PK-type error code */
f6883df
 {
f6883df
     int do_this_file=FALSE, cfactor, error, error_in_archive=PK_COOL;
f6883df
 #ifndef WINDLL
f6883df
-    char sgn, cfactorstr[10];
f6883df
+    char sgn, cfactorstr[13];
f6883df
     int longhdr=(uO.vflag>1);
f6883df
 #endif
f6883df
     int date_format;
f6883df
@@ -339,7 +339,19 @@ int list_files(__G)    /* return PK-type error code */
f6883df
                 G.crec.compression_method == ENHDEFLATED) {
f6883df
                 methbuf[5] = dtype[(G.crec.general_purpose_bit_flag>>1) & 3];
f6883df
             } else if (methnum >= NUM_METHODS) {
f6883df
-                sprintf(&methbuf[4], "%03u", G.crec.compression_method);
f6883df
+                /* 2013-02-26 SMS.
f6883df
+                 * http://sourceforge.net/tracker/?func=detail
f6883df
+                 *  &aid=2861648&group_id=118012&atid=679786
f6883df
+                 * Unexpectedly large compression methods overflow
f6883df
+                 * &methbuf[].  Use the old, three-digit decimal format
f6883df
+                 * for values which fit.  Otherwise, sacrifice the
f6883df
+                 * colon, and use four-digit hexadecimal.
f6883df
+                 */
f6883df
+                if (G.crec.compression_method <= 999) {
f6883df
+                    sprintf( &methbuf[ 4], "%03u", G.crec.compression_method);
f6883df
+                } else {
f6883df
+                    sprintf( &methbuf[ 3], "%04X", G.crec.compression_method);
f6883df
+                }
f6883df
             }
f6883df
 
f6883df
 #if 0       /* GRR/Euro:  add this? */