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