altos: Deal with 8-character version numbers
[fw/altos] / src / kernel / ao_cmd.c
index cbee3cd5109cae00f10343519dd7e08540fdc27a..d8ba8372f5d0e308109ad6bd17c84a1a7c0d4541 100644 (file)
@@ -270,6 +270,8 @@ ao_reboot(void)
 #endif
 
 #if HAS_VERSION
+#define _stringify(x) #x
+#define stringify(x) _stringify(x)
 static void
 version(void)
 {
@@ -307,7 +309,7 @@ version(void)
               , (unsigned) ((uint32_t) AO_BOOT_APPLICATION_BOUND - (uint32_t) AO_BOOT_APPLICATION_BASE)
 #endif
                );
-       printf("software-version %s\n", ao_version);
+       printf("software-version %." stringify(AO_MAX_VERSION) "s\n", ao_version);
 }
 #endif