bbtime (0.1.5-12) resource.cc

Summary

 resource.cc |   15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

    
download this patch

Patch contents

--- bbtime-0.1.5.orig/resource.cc
+++ bbtime-0.1.5/resource.cc
@@ -462,10 +462,17 @@
   }
   else {
     delete [] report.strftimeFormat;
-    int len=strlen("%I:%M %p");
-    report.strftimeFormat = new char [len +1];
-    memset(report.strftimeFormat,0,len+1);
-    strncpy(report.strftimeFormat,"%I:%M %p",len);
+    if(report.clock24Hour) {
+      int len=strlen("%H:%M");
+      report.strftimeFormat = new char [len +1];
+      memset(report.strftimeFormat,0,len+1);
+      strncpy(report.strftimeFormat,"%H:%M",len);
+    } else {
+      int len=strlen("%I:%M %p");
+      report.strftimeFormat = new char [len +1];
+      memset(report.strftimeFormat,0,len+1);
+      strncpy(report.strftimeFormat,"%I:%M %p",len);
+    }
   }
 
 #ifdef    HAVE_STRFTIME