neofetch icon indicating copy to clipboard operation
neofetch copied to clipboard

Error with showing ram usage

Open Zbysiu3cytryny opened this issue 3 years ago • 0 comments

  • [X] Does this issue still occur in the master branch? (Required if issue)

Neofetch version

7.1.0-2

Screenshot

image

Config file

config.txt

Verbose log

neofetchlog.txt

Zbysiu3cytryny avatar Aug 09 '22 18:08 Zbysiu3cytryny

00036280: value too great for base (error token is "00036280")

Looking into this, I believe it thinks its octal because of the leading zero when parsing /proc/meminfo... but the input is decimal and padded with zeros.

One way to fix this is to strip the leading zeros within the script.

Please apply this diff and report:

--- /usr/bin/neofetch	2022-08-20 03:17:00.242076721 +0300
+++ /usr/bin/neofetch.bak	2022-08-20 03:17:26.740413196 +0300
@@ -2540,6 +2540,7 @@
             # MemUsed = Memtotal + Shmem - MemFree - Buffers - Cached - SReclaimable
             # Source: https://github.com/KittyKatt/screenFetch/issues/386#issuecomment-249312716
             while IFS=":" read -r a b; do
+            	b=${b#"${b%%[1-9]*}"}
                 case $a in
                     "MemTotal") ((mem_used+=${b/kB})); mem_total="${b/kB}" ;;
                     "Shmem") ((mem_used+=${b/kB}))  ;;

Chikmyvoltage avatar Aug 20 '22 00:08 Chikmyvoltage

00036280: value too great for base (error token is "00036280")

Looking into this, I believe it thinks its octal because of the leading zero when parsing /proc/meminfo... but the input is decimal and padded with zeros.

One way to fix this is to strip the leading zeros within the script.

Please apply this diff and report:

--- /usr/bin/neofetch	2022-08-20 03:17:00.242076721 +0300
+++ /usr/bin/neofetch.bak	2022-08-20 03:17:26.740413196 +0300
@@ -2540,6 +2540,7 @@
             # MemUsed = Memtotal + Shmem - MemFree - Buffers - Cached - SReclaimable
             # Source: https://github.com/KittyKatt/screenFetch/issues/386#issuecomment-249312716
             while IFS=":" read -r a b; do
+            	b=${b#"${b%%[1-9]*}"}
                 case $a in
                     "MemTotal") ((mem_used+=${b/kB})); mem_total="${b/kB}" ;;
                     "Shmem") ((mem_used+=${b/kB}))  ;;

Thanks for help, but kernel maintainer fixed that problem some time ago

Zbysiu3cytryny avatar Aug 31 '22 04:08 Zbysiu3cytryny