tFix battprint arguments for non-openbsd - spoon - [fork] customized build of spoon, the dwm status utility
 (HTM) git clone git://src.adamsgaard.dk/spoon
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) LICENSE
       ---
 (DIR) commit 0b5d0726bfff81af35ec51db72494cc0941a5a7d
 (DIR) parent 0923a1296f40894c00d8e77cb5203cf6f70a0a2b
 (HTM) Author: Anders Damsgaard <anders@adamsgaard.dk>
       Date:   Wed,  3 Jun 2020 15:59:55 +0200
       
       Fix battprint arguments for non-openbsd
       
       Diffstat:
         M batt.c                              |       4 ++--
       
       1 file changed, 2 insertions(+), 2 deletions(-)
       ---
 (DIR) diff --git a/batt.c b/batt.c
       t@@ -16,7 +16,7 @@ battprint(char *buf, size_t len, int acon, int life, int remain)
                static int frame = 0;
        
                c = acon ? '=' : ' ';
       -        if (c == ' ')
       +        if (c == ' ' && remain != 0)
                        snprintf(buf, len, "%d%% %d:%02d", life, remain/60, remain%60);
                else
                        snprintf(buf, len, "%d%%", life);
       t@@ -80,7 +80,7 @@ battread(void *arg, char *buf, size_t len)
                }
                fscanf(fp, "%d", &acon);
                fclose(fp);
       -        battprint(buf, len, acon, life);
       +        battprint(buf, len, acon, life, 0);
                return 0;
        }
        #endif