all repos — slstatus @ 84a2f117a32f0796045941260cdc4b69852b41e0

my build of slstatus (tools.suckless.org/slstatus/)

84a2f117
Update README
Aaron Marcher me@drkhsh.at
Mon, 30 Nov 2020 21:32:14 +0100
ae8a658d
Update LICENSE
Aaron Marcher me@drkhsh.at
Mon, 30 Nov 2020 21:26:40 +0100
dd5bfc3e
Add comment for FreeBSD to config.mk

Apparently `-lkvm` is needed for swap on FreeBSD

Thanks to Micheal Buch and Jason Smith
(See thread https://lists.suckless.org/dev/1907/33594.html)
Aaron Marcher me@drkhsh.at
Mon, 30 Nov 2020 20:56:21 +0100
9ac721c2
Use the sioctl_open(3) OpenBSD API to access vol

Starting with OpenBSD 6.7 regular users cannot access raw audio devices
anymore, for improved security.

Instead use the sioctl_open(3) API to access and manipulate audio
controls exposed by sndiod(8). On the first call a permanent connection
is established with the running sndiod daemon, and call-back functions
are registered which are triggered when audio controls are changed
(e.g., a USB headset is attached) or when the volume is modified. On
subsequent calls we poll for changes; if there are no volume changes
this costs virtually nothing.

Joint work with Alexandre Ratchov
Ingo Feinerer feinerer@logic.at
Sat, 09 May 2020 12:03:20 +0200
aaf279f6
Add a -1 option flag

Allow slstatus to be used by programs that can grab status by calling
an external program on a periodic basis (e.g. tmux)
Daniel Moch daniel@danielmoch.com
Tue, 23 Jun 2020 16:35:43 -0400
d1b23e55
Handle SIGUSR1 for forced refreshes

At some point one might want to force a refresh for example after
checking email or changing the volume. Sending a SIGUSR1 achieves this
now
Mart Lubbers mart@martlubbers.net
Thu, 18 Jun 2020 08:46:12 +0200
3fc2872d
Fix temperature reporting on OpenBSD

On OpenBSD although the formula is correct due to integer division a
temperature of for example 54 celsius appears as 5. this patch first
treats it as a floating point op before retaining the non decimal digits
dsp dsp@2f30.org
Thu, 31 Oct 2019 22:50:32 -0600
3ac985eb
Full battery indicator

When you reach full charge the symbol would change
to a question mark "?" as "Full" was not defined,
now it changes to an "o" instead.
Cem Keylan cem@ckyln.com
Wed, 02 Oct 2019 11:31:54 +0300
2b0f50d1
Add separator module
Ryan Kes alrayyes@gmail.com
Sat, 30 Mar 2019 13:45:05 +0100
b14e0396
Follow International System of Units spacing rules
Ingo Feinerer feinerer@logic.at
Sat, 16 Feb 2019 17:59:44 +0100
93daf4f3
Add OS-support notice to README
Aaron Marcher me@drkhsh.at
Sat, 16 Feb 2019 17:05:04 +0100
a1ac203d
Add ram and swap components on FreeBSD
Michael Buch michaelbuch12@gmail.com
Sat, 16 Feb 2019 01:26:44 +0000
10bdf01b
cpu_perc: Check for division by zero
Ingo Feinerer feinerer@logic.at
Thu, 14 Feb 2019 19:25:51 +0100
d518472e
Fix CPU frequency on OpenBSD
Ingo Feinerer feinerer@logic.at
Wed, 13 Feb 2019 15:45:40 +0100
a9193a75
close file descriptors and fix return values
Michael Buch michaelbuch12@gmail.com
Wed, 13 Feb 2019 14:16:17 +0000
c1dc896c
Add native OpenBSD support for mute/volume

Based on functionality in dstat by Joerg Jung.
Ingo Feinerer feinerer@logic.at
Fri, 08 Feb 2019 15:37:17 +0100
e724907c
wifi component on FreeBSD
Michael Buch michaelbuch12@gmail.com
Wed, 13 Feb 2019 00:47:23 +0000
86849d29
Add FreeBSD support for netspeeds, entropy and ip components
Michael Buch michaelbuch12@gmail.com
Wed, 30 Jan 2019 11:21:54 +0000
b6d0bd2f
Update LICENSE
Aaron Marcher me@drkhsh.at
Tue, 05 Feb 2019 09:32:47 +0100
120d1505
Add support for cpu and uptime components on FreeBSD
Michael Buch michaelbuch12@gmail.com
Tue, 05 Feb 2019 02:44:37 +0000
ec306623
Add FreeBSD support for temperature and battery components
Michael Buch michaelbuch12@gmail.com
Sun, 27 Jan 2019 15:44:39 +0000
dd7f1896
ram: Consistency with line breaks
Aaron Marcher me@drkhsh.at
Sun, 08 Jul 2018 17:45:32 +0200
e213b481
Fix whitespace
Aaron Marcher me@drkhsh.at
Sun, 08 Jul 2018 17:44:53 +0200
96ddf4e1
Consistency with 80 char limit and breaks
Aaron Marcher me@drkhsh.at
Sun, 08 Jul 2018 17:42:58 +0200
c9397174
wifi_perc: Simplify on Linux

Remove unnecessary variable
Aaron Marcher me@drkhsh.at
Sat, 07 Jul 2018 14:05:53 +0200
acfa1f50
Simplify format specifiers for uintmax_t
Aaron Marcher me@drkhsh.at
Sat, 07 Jul 2018 11:08:26 +0200
c2492c3f
cpu_freq: Simplify with E-notation

Thanks to the FRIGN
Aaron Marcher me@drkhsh.at
Sat, 07 Jul 2018 10:56:10 +0200
e20b5011
cpu_freq: Change to 64 bit integers

Remove unnecessary cast to size_t
Aaron Marcher me@drkhsh.at
Sat, 07 Jul 2018 10:54:12 +0200
43a12832
Change uint64_t to uintmax_t
Aaron Marcher me@drkhsh.at
Sat, 07 Jul 2018 10:50:25 +0200
d76b1a21
battery: 64 bit ints on Linux
Aaron Marcher me@drkhsh.at
Sat, 07 Jul 2018 10:31:57 +0200
b792b7ab
cpu: Use uint64_t on OpenBSD
Aaron Marcher me@drkhsh.at
Sat, 07 Jul 2018 00:24:36 +0200
609ef3aa
battery: Remove unnecessary defines for paths
Aaron Marcher me@drkhsh.at
Fri, 06 Jul 2018 23:55:18 +0200
16e15217
uptime: Improve typing and sort headers
Aaron Marcher me@drkhsh.at
Fri, 06 Jul 2018 23:47:52 +0200
d1e33988
temperature: Improve types
Aaron Marcher me@drkhsh.at
Fri, 06 Jul 2018 23:41:02 +0200
ab4f24a6
ram: Check for theoretical division by zero
Aaron Marcher me@drkhsh.at
Fri, 06 Jul 2018 23:38:12 +0200
fa7c266e
ram: Use POSIX types
Aaron Marcher me@drkhsh.at
Fri, 06 Jul 2018 23:37:05 +0200
b65c0585
entropy: Use POSIX types for format specifiers
Aaron Marcher me@drkhsh.at
Fri, 06 Jul 2018 23:26:12 +0200
c59b64e6
entropy: Improve types
Aaron Marcher me@drkhsh.at
Fri, 06 Jul 2018 23:17:08 +0200
51ff7ce2
Consistent paramter naming for components
Aaron Marcher me@drkhsh.at
Fri, 06 Jul 2018 08:08:48 +0200
efa26f4f
slstatus.h: Fix coding style

Function declarations should include variable names.
For functions with different parameters on different platfroms they are
left out.
Aaron Marcher me@drkhsh.at
Fri, 06 Jul 2018 08:03:31 +0200
381c2fa1
fmt_human: Improve types

size_t may not be enough, use 64 bit integers
Aaron Marcher me@drkhsh.at
Fri, 06 Jul 2018 07:56:46 +0200
1452a448
Add Ian Remmler to LICENSE
Aaron Marcher me@drkhsh.at
Mon, 04 Jun 2018 14:07:20 +0200
32e0a2bf
Add flexible formatting to keyboard_indicators.

Updated for style.
Ian Remmler ian@remmler.org
Sun, 03 Jun 2018 20:02:34 -0500
005b5417
uptime: unification of the uptime function for linux/openbsd
Tobias Tschinkowitz tobias@he4d.net
Fri, 01 Jun 2018 20:10:34 +0200
8c8091f4
wifi: fixed disconnected wifi status on openbsd
Tobias Tschinkowitz tobias@he4d.net
Thu, 31 May 2018 13:53:49 +0200
b0401b13
Clean up header includes

 - Remove <errno.h> because related functions are in util.c now
 - Remove corresponding <string.h> if not used otherwise
Aaron Marcher me@drkhsh.at
Wed, 30 May 2018 19:35:37 +0200
c0436810
Update LICENSE for Quentin
Aaron Marcher me@drkhsh.at
Tue, 29 May 2018 22:26:40 +0200
7fe24085
Flush the output stream instead of arbitrarily disabling buffering

This is (arguably) more elegant and it matches Xlib output logic.
Also use puts instead of printf as we don't do formating there.
Quentin Rameau quinq@fifth.space
Tue, 29 May 2018 21:32:29 +0200
81d5b427
Don't explicitly list each component-target

I made a mistake while reading the Posix spec. In fact, the implicit
prerequisite imposed by the .c.o-rule is evaluated as expected, even if
the .c is not given in the target rule.

This partially reverts 0efd64ffaa04715eff9c834c437562952c4531cd.
Laslo Hunhold dev@frign.de
Tue, 29 May 2018 21:24:43 +0200
0c29fc56
swap: removed unused include
Tobias Tschinkowitz tobias@he4d.net
Tue, 29 May 2018 14:28:39 +0200
a18439af
Refactor swap.c to use getline() instead of buf-filling

This drops a lot of code and even though we are using a common function,
the specification of only the needed things keeps it very efficient and
even more efficient in memory and time than the previous solution.
Laslo Hunhold dev@frign.de
Mon, 28 May 2018 21:16:02 +0200
5d641560
Update LICENSE for Tobias
Aaron Marcher me@drkhsh.at
Mon, 28 May 2018 16:17:03 +0200
cd884c2f
Fix object order and stop using a GNU make idiom
Laslo Hunhold dev@frign.de
Mon, 28 May 2018 15:58:28 +0200
0efd64ff
Explicitly list component-objects in the Makefile

There was a long tinkering process at farbfeld about this, but the sad
truth is that it's the only way to make the Makefile truly portable.
Listing it just as

   $(COM:=.o): config.mk $(REQ:=.h)

omits the dependency on the c-file itself, which incurs that strictly
speaking the object file is not depending on the source file, which is
nonsense.

You don't see strictly Posix compliant Makefiles around very often and
most use nasty GNU-extensions everywhere. It is a good idea to go ahead
as a fitting example and show how to write them portably.
Laslo Hunhold dev@frign.de
Sun, 27 May 2018 22:40:00 +0200
682c0fed
Use E-notation for large powers of 10
Laslo Hunhold dev@frign.de
Sun, 27 May 2018 17:57:52 +0200
c28643ce
Revert "Add basic backlight percentage support"

On OpenBSD the backlight percentage cannot be retrieved in a simple way.
The only two solutions we are aware of for now are:

 - reading from /dev/ttyC0: which isn't possible without changing
 permissions or running slstatus as root
 - linking against xcb-xrandr: which is bloat and does not work in every
 case appearently

This reverts commit 37724ac2c3f496f4736223d0d8e5d8fecb933590 for now.
Aaron Marcher me@drkhsh.at
Sun, 27 May 2018 16:46:03 +0200
5db729fe
ram: fixed int overflow on pagetok macro
Tobias Tschinkowitz he4d@posteo.de
Thu, 24 May 2018 12:09:26 +0200
f17f39d0
Refactor keymap.c

 - Get rid of camel-casing
 - Don't use all-caps for variable names
 - use LEN()-macro
 - use strncmp() rather than strstr() for prefix-checking
 - clean up the tokenizer-loop and don't use copies
 - make the loop more readable by separating different breaking
   conditions
 - stricter error-checking and cleanup
 - store the layout directly with bprintf rather than having
   a separate buffer
Laslo Hunhold dev@frign.de
Wed, 23 May 2018 15:29:37 +0200
13d77cd2
Refactor snprintf-usage in util.c
Laslo Hunhold dev@frign.de
Wed, 23 May 2018 13:51:50 +0200
d6ad87ce
keymap: Add braces for for loop
Aaron Marcher me@drkhsh.at
Wed, 23 May 2018 13:30:45 +0200
385aedff
Add keymap to README
Aaron Marcher me@drkhsh.at
Wed, 23 May 2018 11:50:08 +0200
cf2b6045
Add Michael Buch to LICENSE
Aaron Marcher me@drkhsh.at
Wed, 23 May 2018 10:12:20 +0200
943b42de
Add keymap component

Adding a new keymap component that will
indicate the current keyboard layout (language)
and variant if any was set. I use the
standard X11 XKB APIs to retrieve and parse
the xkb_symbols set with setxkbmap.
Michael Buch michaelbuch12@gmail.com
Wed, 23 May 2018 07:16:30 +0100
57f69e90
Remove o-flag as it is redundant

Even if we extend the flag to be an n-flag with a numerical input, we
already have other Unix-tools to take care of us much more flexibly,
e.g. with head(1) you can easily get the first 10 outputs with

	slstatus -s | head -n 10,

but also e.g. discard the first one and then get the consecutive 10
outputs.

For the X11-root-window-name, you can limit the runtime with timeout(1)
or a comparable solution.

This reverts commit fa8b939990ed0648f99b0cbeba4efed807160db3.
Laslo Hunhold dev@frign.de
Mon, 21 May 2018 21:31:53 +0200
9c9ce8a1
Check printf() for output errors

This way cases like

	$ slstatus -s > /dev/full

are properly caught and the program terminated with the proper return
code.
Laslo Hunhold dev@frign.de
Tue, 22 May 2018 12:50:43 +0200
825f637e
netspeeds: Fix indentation
Aaron Marcher me@drkhsh.at
Tue, 22 May 2018 12:42:31 +0200
37724ac2
Add basic backlight percentage support

At the moment linux only, but will add support for OpenBSD as well.
David Demelier markand@malikania.fr
Tue, 22 May 2018 09:23:29 +0200
cbbf59fd
Change to fmt_human in netspeeds on OpenBSD

Thanks to Hiltjo
Aaron Marcher me@drkhsh.at
Tue, 22 May 2018 12:21:52 +0200
7f91ce26
swap.c: Refactor getstats() and its usage

Add a return value so we are able to check any errors and actually fail
when there has been a critical error instead of carrying on uselessly.
Laslo Hunhold dev@frign.de
Mon, 21 May 2018 23:03:34 +0200
ceb13206
Refactor fmt_human() and fix a bug

It is not necessary to copy memory or anything. Just keep a pointer to
the active prefix-array and assign the length of the arrays to a
variable.

Make the code more readable by using a switch, be more strict when an
invalid base is passed to it and fix a small oversight in the bottom of
the code where the base 1024 was forgotten to generalized.
Laslo Hunhold dev@frign.de
Mon, 21 May 2018 20:08:56 +0200
10dbc954
Merge fmt_human_2 and fmt_human_10 to one function

Now only one function, fmt_human, takes an additional argument "base".
Aaron Marcher me@drkhsh.at
Mon, 21 May 2018 14:44:21 +0200
fc0dde5a
Remove fmt from load_avgs for consistency

In a later commit something like that will be enabled for every
component
Aaron Marcher me@drkhsh.at
Mon, 21 May 2018 14:14:45 +0200
fa8b9399
Add option to output only once and exit
Aaron Marcher me@drkhsh.at
Mon, 21 May 2018 14:07:41 +0200
aa865479
battery_remaining: check for division by zero
Aaron Marcher me@drkhsh.at
Mon, 21 May 2018 00:42:06 +0200
a546d4b5
battery_remaining: Change float to double
Aaron Marcher me@drkhsh.at
Mon, 21 May 2018 00:41:03 +0200
103945e7
battery: Minor coding style fixes

- Line length
- Spacing and indentation
- No explicit checks for NULL
Aaron Marcher me@drkhsh.at
Mon, 21 May 2018 00:36:59 +0200
bae576cd
Increase readability for load_uvmexp return
Aaron Marcher me@drkhsh.at
Mon, 21 May 2018 00:29:54 +0200
ec5c35ec
Remove units from numbers

This is a first step to decouple formatting from information because of
two reasons:

 1. The components should only gather and return the values by design
 2. Fine grained user control should be a focus

Scaling will be implemented in a different way in a later commit.
Aaron Marcher me@drkhsh.at
Mon, 21 May 2018 00:16:54 +0200
4bd234c7
swap_perc: check for division by zero on obsd too
Aaron Marcher me@drkhsh.at
Mon, 21 May 2018 00:02:33 +0200
80681577
swap_perc: check for division by zero
Aaron Marcher me@drkhsh.at
Sun, 20 May 2018 23:53:26 +0200
d8ce4e69
Add David Demelier to LICENSE
Aaron Marcher me@drkhsh.at
Sun, 20 May 2018 22:16:39 +0200
f386a03a
Support energy_now/power_now in battery_remaining

On some laptops (mostly thinkpads), the remaining time may be
expressed in µWh using energy_now and power_now files rather than µAh
for charge_now and current_now.

Add pick function to conditionally select appropriate one.
David Demelier markand@malikania.fr
Sun, 20 May 2018 09:42:16 +0200
1cd8a7b5
ip: fixed memory leak

free the interface list before returning from the function
Tobias Tschinkowitz he4d@posteo.de
Sun, 20 May 2018 15:53:48 +0200
b640cc48
Check return value of pclose()
Laslo Hunhold dev@frign.de
Sun, 20 May 2018 00:57:24 +0200
c12b9cc5
Refactor ram.c
Aaron Marcher me@drkhsh.at
Sun, 20 May 2018 00:42:07 +0200
7873b3b1
Make temp more readable on Linux
Aaron Marcher me@drkhsh.at
Sun, 20 May 2018 00:30:16 +0200
951ea4e3
Refactor entropy.c
Laslo Hunhold dev@frign.de
Sun, 20 May 2018 00:18:08 +0200
3f45a5f7
Remove initialization to 0 for static vars
Aaron Marcher me@drkhsh.at
Sun, 20 May 2018 00:17:35 +0200
a7ade0dc
Remove unnecessary "valid" variable in cpu_perc
Aaron Marcher me@drkhsh.at
Sun, 20 May 2018 00:16:20 +0200
062f33f8
Add unit to temperature
Aaron Marcher me@drkhsh.at
Sun, 20 May 2018 00:02:49 +0200
0bc68557
Implement scaling for cpu_freq
Aaron Marcher me@drkhsh.at
Sat, 19 May 2018 23:58:14 +0200
46c4540d
Implement fmt_human_2() and fmt_human_10()

These functions take the raw number and a unit and automatically
print it out "scaled down" to a proper SI-prefix, for powers of 2
and 10 respectively.

Apply them to the 2-power cases and keep the 10-power for a later
commit.
Laslo Hunhold dev@frign.de
Sat, 19 May 2018 22:52:17 +0200
74c4f4eb
Add the percent sign to *_perc functions

Units should be added to the corresponding numbers
Aaron Marcher me@drkhsh.at
Sat, 19 May 2018 20:33:06 +0200
68a3902d
Increase precision in netspeeds.c

First dividing by interval before multiplying with 1000 decreases the
precision by +-(interval - 1) * 1000, as interval arithmetic always
applies the Gauß-function to the result.

This is not necessary and simply reordering the operations mitigates
this.
Laslo Hunhold dev@frign.de
Sat, 19 May 2018 20:09:38 +0200
422cadfd
Implement esnprintf() and make formatted calls more efficient

Within the components, snprintf() was unchecked and had inefficient
calls in some places.
We implement esnprintf() that does all the dirty laundry for us
and use it exclusively now.
Laslo Hunhold dev@frign.de
Sat, 19 May 2018 19:33:04 +0200
f31b113e
Simplify ipv* functions
Aaron Marcher me@drkhsh.at
Sat, 19 May 2018 13:34:18 +0200
d47d7825
Use `int` for flags
Aaron Marcher me@drkhsh.at
Sat, 19 May 2018 13:29:21 +0200
74891945
Revert aac29e2 as it is nonsense
Aaron Marcher me@drkhsh.at
Sat, 19 May 2018 13:25:35 +0200
06d4447f
Set {r,t}xbytes 0 before incrementing them on OBSD
Aaron Marcher me@drkhsh.at
Sat, 19 May 2018 13:19:53 +0200
a37224bf
Missing assignment for last commit
Aaron Marcher me@drkhsh.at
Sat, 19 May 2018 13:12:06 +0200
e3ccac32
Unify and simplify netspeed logic and types
Aaron Marcher me@drkhsh.at
Sat, 19 May 2018 13:07:05 +0200
2321aecf
netspeeds: added error condition for openbsd

implemented additional error condition for openbsd netstat in case the
interface could not be found in the interface list or if_data is not
readable.
Tobias Tschinkowitz he4d@posteo.de
Sat, 19 May 2018 11:23:16 +0200
0383146e
uptime: Format function is static
Aaron Marcher me@drkhsh.at
Sat, 19 May 2018 01:55:31 +0200
aac29e2b
battery: Move out struct as common code
Aaron Marcher me@drkhsh.at
Sat, 19 May 2018 01:49:46 +0200
22175f0d
implemented openbsd netspeed functions

implemented the netspeed functionality for openbsd.
furthermore the static keyword was removed of the interval variable in
config.def.h for usage as extern variable.
Tobias Tschinkowitz he4d@posteo.de
Sat, 19 May 2018 01:29:20 +0200
176d8ff8
Add netspeeds to config.def.h
Aaron Marcher me@drkhsh.at
Sat, 19 May 2018 00:40:59 +0200
0d05b3d1
Add network speed functions
Aaron Marcher me@drkhsh.at
Sat, 19 May 2018 00:31:33 +0200
d0c68989
Implement fmt_scaled for ram_* functions
Aaron Marcher me@drkhsh.at
Fri, 18 May 2018 23:38:59 +0200
49d1e5fa
Fix ram_free for Linux
Aaron Marcher me@drkhsh.at
Fri, 18 May 2018 23:32:00 +0200
39ee31c2
Implement fmt_scaled for swap_* functions
Aaron Marcher me@drkhsh.at
Fri, 18 May 2018 23:19:18 +0200
b3e56066
Implement fmt_scaled for disk_* functions
Aaron Marcher me@drkhsh.at
Fri, 18 May 2018 23:14:55 +0200
35219d39
Add fmt_scaled util function
Aaron Marcher me@drkhsh.at
Fri, 18 May 2018 23:14:10 +0200
f3178199
Use %d instead of accidentally %i
Aaron Marcher me@drkhsh.at
Fri, 18 May 2018 19:58:51 +0200
f1700285
Port battery_remaining to Linux

Additionally unify the format of battery_state and uptime
Aaron Marcher me@drkhsh.at
Fri, 18 May 2018 17:25:09 +0200
b04ca3ef
Fix memory leak
Aaron Marcher me@drkhsh.at
Fri, 18 May 2018 16:55:37 +0200
367f8a8c
battery: fixed remaining time on connected AC

when an AC is connected apm_info shows a non-valid value for remaining
minutes. it was decided that in that case the function should return an
empty string.
Tobias Tschinkowitz he4d@posteo.de
Fri, 18 May 2018 16:33:51 +0200
2604f25b
Fix indentation

Tabs for indentation, spaces for alignment
Aaron Marcher me@drkhsh.at
Fri, 18 May 2018 15:32:15 +0200
8c8326f7
Add battery_remaining function on OpenBSD

Implementation of a battery_remaining function which returns the
remaining battery time in HH:MM format. Linux function still needs
implementation.
Move common code to load_apm_power_info
Tobias Tschinkowitz he4d@posteo.de
Fri, 18 May 2018 14:43:04 +0200
80fc20d1
Add warn() and die()

Given slstatus is a tool that runs in the background, most likely run
from .xinitrc, it's important to prepend the name of the tool to error
messages so it becomes clear where the error is coming from.

To make this much more consistent, this commit adds warn() and die()
utility functions consistent with other suckless projects and adapts all
calls to fprintf(stderr, *) to the warn() and die() functions, greatly
increasing the readability of the code.
Laslo Hunhold dev@frign.de
Fri, 18 May 2018 10:59:05 +0200
a4fe8c97
Audit slstatus.c

 1) Remove setlocale() (locales are harmful and any 'issues' shall
    be fixed in different ways that are expected).
 2) Disable buffering on stdout with setbuf() rather than flushing
    it each time.
 3) Make error messages more consistent.
 4) Add error checks where applicable.
 5) Make code a bit more readable where res is assigned.
 6) Use XFlush() rather than XSync() (we don't need to wait for the
    XServer to react, which could lead to long hangs on our side).
Laslo Hunhold dev@frign.de
Fri, 18 May 2018 10:07:50 +0200
c83b388a
Properly handle *snprintf() errors

Posix guarantees that the resulting string is null-terminated, even if
we have an overflow. Instead of doing what has already been done,
properly warn when there has been an error or overflow, so the user can
do something about it.
Laslo Hunhold dev@frign.de
Thu, 17 May 2018 23:23:28 +0200
b7596629
Remove UNUSED macro

Use variables named unused instead which is simpler
Aaron Marcher me@drkhsh.at
Thu, 17 May 2018 20:05:57 +0200
fc8b6f81
Mark unused parameters, fix compiler warnings
Aaron Marcher me@drkhsh.at
Thu, 17 May 2018 18:29:25 +0200
977be0cf
wifi: Fix order and add missing header

<sys/select.h> is needed before <net80211/ieee80211_ioctl.h> on OpenBSD
to define NBBY and shut up compiler warnings.
Aaron Marcher me@drkhsh.at
Thu, 17 May 2018 18:14:08 +0200
ca8a146f
wifi: Change memmove to memcpy on OpenBSD
Aaron Marcher me@drkhsh.at
Thu, 17 May 2018 18:08:31 +0200
7ab183c9
Unify type of  in for loops
Aaron Marcher me@drkhsh.at
Thu, 17 May 2018 18:05:38 +0200
1c44d404
wifi_essid: Fix coding style

Only initialize variables at the beginning of a block
Aaron Marcher me@drkhsh.at
Thu, 17 May 2018 17:59:05 +0200
7be675f1
Unify type of `i` in for loops

int for normal indexes
size_t for usage with the LEN macro
Aaron Marcher me@drkhsh.at
Thu, 17 May 2018 17:40:11 +0200
f9609f4f
Change done to int as it is the CPU's natural type
Aaron Marcher me@drkhsh.at
Thu, 17 May 2018 17:28:32 +0200
11ce8ed0
Change interval to unsigned int
Aaron Marcher me@drkhsh.at
Thu, 17 May 2018 17:25:31 +0200
0892a93d
Add comments for battery_* functions on OpenBSD
Aaron Marcher me@drkhsh.at
Thu, 17 May 2018 17:24:47 +0200
1cb5af98
added comment for temp function (openbsd)
Tobias Tschinkowitz he4d@posteo.de
Thu, 17 May 2018 13:19:29 +0200
0f46c675
corrected calculations for disk space on openbsd
Tobias Tschinkowitz he4d@posteo.de
Thu, 17 May 2018 12:43:21 +0200
1b3fafd7
Update README
Aaron Marcher me@drkhsh.at
Wed, 16 May 2018 23:19:33 +0200
bb613923
wifi: Fix coding style

Use block for single statement ifs
When functions return -1 for error test against 0 not -1
Newlines
Aaron Marcher me@drkhsh.at
Wed, 16 May 2018 23:17:30 +0200
9d967498
load_ieee80211_nodereq: Fix typo
Aaron Marcher me@drkhsh.at
Wed, 16 May 2018 23:08:33 +0200
f3c23f08
wifi: Move out common headers
Aaron Marcher me@drkhsh.at
Wed, 16 May 2018 22:57:13 +0200
1fc5cf00
added wifi functionality for openbsd

display ESSID and signal strength percentage
Tobias Tschinkowitz he4d@posteo.de
Wed, 16 May 2018 22:37:43 +0200
c1f79d74
corrected calculation for swap on openbsd

The swapctl(2) function fills the swapent struct with 512KB blocks.
As we want to display in GB, i just modified the calculation for this to
get the expected output.
Tobias Tschinkowitz he4d@posteo.de
Wed, 16 May 2018 13:26:34 +0200
82eb6e38
consistent calculation of ram_* on openbsd
Tobias Tschinkowitz he4d@posteo.de
Wed, 16 May 2018 09:57:38 +0200
ca02afb1
Add he4d to LICENSE
Aaron Marcher me@drkhsh.at
Wed, 16 May 2018 08:13:09 +0200
0f9a1a83
updated ram_total and ram_free (obsd)
Tobias Tschinkowitz he4d@posteo.de
Wed, 16 May 2018 00:45:41 +0200
6464cea3
Cast CPU percentage to int and fix indenation
Aaron Marcher me@drkhsh.at
Mon, 14 May 2018 20:54:48 +0200
7e29da02
fflush(stdout) to print line by line if stdout is not a tty

To reproduce the issue:
	$ slstatus -s | tee

then it would print only when the stdout buffer is full, by block
of multiple lines.

fflush() makes sure the line is printed at every loop iteration
Josuah Demangeon mail@josuah.net
Tue, 08 May 2018 15:13:56 +0200
0f7a34fa
Add josuah to LICENSE
Aaron Marcher me@drkhsh.at
Tue, 08 May 2018 15:06:55 +0200
ea2e2bd0
include <sys/time.h> before <sys/sensors.h> for time struct timeval

sys/sensors.h has two structs struct timeval: sensor and ksensor:

	struct sensor {
		...
		struct timeval tv;		/* sensor value last change time */
		...
	};
Josuah Demangeon mail@josuah.net
Tue, 08 May 2018 13:42:17 +0200
666f2852
Only variable declarations at top of block
Aaron Marcher me@drkhsh.at
Mon, 07 May 2018 15:57:32 +0200
6123f482
Fix indents (spaces for alignment)
Aaron Marcher me@drkhsh.at
Mon, 07 May 2018 13:48:43 +0200
6c6c144b
wifi_perc: Simplify
Aaron Marcher me@drkhsh.at
Mon, 07 May 2018 12:25:34 +0200
0a287616
num_files: Variable declarations at top of block
Aaron Marcher me@drkhsh.at
Mon, 07 May 2018 12:17:13 +0200
dcffaeaf
Fix disk_perc by casting it to int
Aaron Marcher me@drkhsh.at
Mon, 07 May 2018 12:14:46 +0200
4fc49835
disk_perc: Simplify
Aaron Marcher me@drkhsh.at
Mon, 07 May 2018 11:44:15 +0200
b3330d84
cpu: Simplify functions
Aaron Marcher me@drkhsh.at
Mon, 07 May 2018 11:39:59 +0200
16a97fbc
Unify header includes

- Sort Alphabetically
- Same indentation for preprocessor clauses
Aaron Marcher me@drkhsh.at
Mon, 07 May 2018 11:21:59 +0200
fbbe300f
entropy: Small fix
Aaron Marcher me@drkhsh.at
Sun, 06 May 2018 23:09:36 +0200
fd14804d
entropy: Port to OpenBSD

OpenBSD's entropy design is superior to Linux.
Aaron Marcher me@drkhsh.at
Sun, 06 May 2018 22:54:32 +0200
62563a5a
datetime: Add <stdio.h> for fprintf
Aaron Marcher me@drkhsh.at
Sun, 06 May 2018 22:41:56 +0200
932f65c3
datetime: Add error message
Aaron Marcher me@drkhsh.at
Sun, 06 May 2018 22:38:29 +0200
ee5ec756
Fix coding style

- Use block for single statement ifs
- Keep lines to reasonable length (current debate as to reasonable)
- When functions return -1 for error test against 0 not -1
- Do not indent cases another level
- Do not test against NULL and 0 explicitly
- Use tabs for indentation, use spaces for alignment
Aaron Marcher me@drkhsh.at
Sun, 06 May 2018 22:28:56 +0200
66a7fb16
Remove cpu_iowait

The third value from load_avg (idle) gives us almost the same
information as cpu_iowait. Plus OpenBSD does not offer an iowait value
as Linux and thus the corresponding function would not be portable.
Aaron Marcher me@drkhsh.at
Sun, 06 May 2018 21:11:50 +0200
235fa3c3
cpu_perc: Documentation and readbility improvements
Aaron Marcher me@drkhsh.at
Sun, 06 May 2018 21:10:02 +0200
2b82bf02
cpu_perc: Port to OpenBSD

In OpenBSD the CPU usage in percent is now computed using KERN_CPTIME
sysctl.
Aaron Marcher me@drkhsh.at
Sun, 06 May 2018 17:48:37 +0200
efb41724
swap_*: Port to OpenBSD
Aaron Marcher me@drkhsh.at
Sun, 06 May 2018 01:20:46 +0200
417f473f
battery: Remove full indicator

It does not respect charging thresholds and it is not trivial to
implement the indicator in OpenBSD.
Aaron Marcher me@drkhsh.at
Fri, 04 May 2018 18:04:53 +0200
699f6734
wifi_perc: Fix file descriptor leak
Aaron Marcher me@drkhsh.at
Wed, 02 May 2018 19:41:53 +0200
af3cdfbb
Add examples to config.def.h
Aaron Marcher me@drkhsh.at
Wed, 02 May 2018 12:30:16 +0200
54ebd0da
uptime: Add missing brace
Aaron Marcher me@drkhsh.at
Wed, 02 May 2018 12:08:54 +0200
34010907
volume: Cast SOUND_MIXER_READ_DEVMASK to int to avoid warning.
parazyd parazyd@dyne.org
Wed, 02 May 2018 11:38:27 +0200
f7a6d6c8
wifi: Various cleanups
Aaron Marcher me@drkhsh.at
Wed, 02 May 2018 08:49:06 +0200
709549b4
user: Only declare variables in the beginning
Aaron Marcher me@drkhsh.at
Wed, 02 May 2018 08:42:55 +0200
e43c3a16
uptime: Simplifiy and clean up
Aaron Marcher me@drkhsh.at
Wed, 02 May 2018 08:41:06 +0200
f0070071
run_command: Clean up
Aaron Marcher me@drkhsh.at
Wed, 02 May 2018 08:29:36 +0200
7c11f890
keyboard_indicators: Clean up opening display
Aaron Marcher me@drkhsh.at
Wed, 02 May 2018 08:26:23 +0200
b2b6eb63
ip: Sort headers alphabetically
Aaron Marcher me@drkhsh.at
Wed, 02 May 2018 08:21:32 +0200
2bd581a4
battery_state: Unify unknown state with "?" symbol
Aaron Marcher me@drkhsh.at
Wed, 02 May 2018 08:16:21 +0200
f5f3808f
Update README todo
Aaron Marcher me@drkhsh.at
Tue, 01 May 2018 21:05:50 +0200
4f5ac5d9
Remove battery_power for various reasons

- Battery power cannot be easily gatherable via apm(4)
- IMHO it does not represent essential information
Aaron Marcher me@drkhsh.at
Tue, 01 May 2018 21:01:25 +0200
24b663d6
Tweak build system a little bit

Be consistent with brackets and add a comment for OpenBSD to make it
clearer what the actual intent of the uncommented line is.

In the Makefile, add a dependency of slstatus.o from config.mk.
Laslo Hunhold dev@frign.de
Tue, 01 May 2018 20:50:53 +0200
41deabf2
battery_perc: Port to OpenBSD
Aaron Marcher me@drkhsh.at
Tue, 01 May 2018 20:45:29 +0200
19343ff3
components/swap.c | move duplicated code to separate function
Laslo Hunhold dev@frign.de
Tue, 01 May 2018 20:20:58 +0200
9750a3d7
Use indentation to increase readability

Granted, this style is definitely not common, but for the short
utility-functions of this program it's just the right choice. This
provides great flexibility, such that in the long run, it will be
possible to also share code between the OS-implementations.

This also keeps the state-keeping at a minimum and makes it clearer
which functions are implemented on which OS without having to jiggle
around with too many files in the process.
Laslo Hunhold dev@frign.de
Tue, 01 May 2018 19:01:22 +0200
42edfea8
Revert component-split

this reverts the commits from 92ab9ef52ebcb097add97d9f78e67ad1c1d6a6ec up to
d42870d6ca7fb587b38f8cf6d6821ae33a53a696.

After heavy consideration, the component split has more disadvantages
than advantages, especially given there will be utility-functions
sharing quite a lot of code that would then need to be duplicated, as it
does not fit into the util.c due to its speciality.

One big advantage of the component-wise build is readability, and
without doubt, this was achieved here. This point will be addressed
with a different approach that will be visible in the upcoming commits.

One big disadvantage of the component build is the fact that it
introduces state to the build process which is not necessary. Before its
introduction, the only influencing factors where the system-defines
__linux__ and __OpenBSD__. With the components, we are also relying on
the output of uname(1).
Additionally, if the os.mk is not present, make gives the output

     $ make
     Makefile:5: os.mk: No such file or directory
     make: *** No rule to make target 'os.mk'.  Stop.

This could easily be fixed by providing some sort of meta-rule for this
file, however, it indicates the problem we have here, and this entire
statefulness will heavily complicate packaging of this tool and makes
the build process much more complex than it actually has to be.
Laslo Hunhold dev@frign.de
Tue, 01 May 2018 18:10:39 +0200
d42870d6
Makefile: add distclean target
Quentin Rameau quinq@fifth.space
Mon, 30 Apr 2018 16:14:05 +0200
2ea3d46f
Makefile: move OS-specific libs to configure script
Quentin Rameau quinq@fifth.space
Mon, 30 Apr 2018 16:13:12 +0200
95665e43
Makefile: separate default flags from user flags
Quentin Rameau quinq@fifth.space
Mon, 30 Apr 2018 16:11:45 +0200
085431b2
Update LICENSE for Quentin Rameau
Aaron Marcher me@drkhsh.at
Mon, 30 Apr 2018 15:44:41 +0200
97ff6652
wifi: OS split
Quentin Rameau quinq@fifth.space
Mon, 30 Apr 2018 15:14:39 +0200
19f3c8f5
uptime: OS split
Quentin Rameau quinq@fifth.space
Mon, 30 Apr 2018 15:14:38 +0200
71eb1d32
temperature: OS split
Quentin Rameau quinq@fifth.space
Mon, 30 Apr 2018 15:14:37 +0200
72f5a0d6
swap: OS split
Quentin Rameau quinq@fifth.space
Mon, 30 Apr 2018 15:14:36 +0200
259e106b
ram: OS split
Quentin Rameau quinq@fifth.space
Mon, 30 Apr 2018 15:14:35 +0200
3cc649e3
entropy: OS split
Quentin Rameau quinq@fifth.space
Mon, 30 Apr 2018 15:14:34 +0200
f088dbfe
cpu: OS split
Quentin Rameau quinq@fifth.space
Mon, 30 Apr 2018 15:14:33 +0200
720569bd
battery: OS split
Quentin Rameau quinq@fifth.space
Mon, 30 Apr 2018 15:14:32 +0200
92ab9ef5
Makefile: detect running OS
Quentin Rameau quinq@fifth.space
Mon, 30 Apr 2018 15:14:31 +0200
3fe1db88
cpu_freq: Port to OpenBSD

In OpenBSD CPU frequency gets fetched using sysctl now.
Aaron Marcher me@drkhsh.at
Mon, 30 Apr 2018 13:20:24 +0200
c3ce506b
Fix typo in temperature
Aaron Marcher me@drkhsh.at
Sun, 29 Apr 2018 22:44:09 +0200
4113a39e
Update README for OpenBSD build
Aaron Marcher me@drkhsh.at
Sun, 29 Apr 2018 22:33:15 +0200
273d3db5
uptime: Separate function for readbility
Aaron Marcher me@drkhsh.at
Sun, 29 Apr 2018 20:07:09 +0200
09950055
battery: Separate function for readbility
Aaron Marcher me@drkhsh.at
Sun, 29 Apr 2018 20:02:42 +0200
cee68110
ram: Move up includes
Aaron Marcher me@drkhsh.at
Sun, 29 Apr 2018 20:00:38 +0200
7baad64a
Sort LICENSE according to first commit
Aaron Marcher me@drkhsh.at
Sun, 29 Apr 2018 18:50:44 +0200
489c6f87
temp: Port to OpenBSD

In OpenBSD temperature gets fetched using sysctl now.
Aaron Marcher me@drkhsh.at
Sun, 29 Apr 2018 18:35:41 +0200
b6d2b652
Remove vol_perc() from todo in README
Aaron Marcher me@drkhsh.at
Sun, 29 Apr 2018 16:08:45 +0200
57b1c171
Update LICENSE for parazyd
Aaron Marcher me@drkhsh.at
Sun, 29 Apr 2018 16:05:53 +0200
d66e775c
Add OpenBSD support in volume.c
parazyd parazyd@dyne.org
Sun, 29 Apr 2018 15:41:18 +0200
53ecbcb3
Update LICENSE for Ali H. Fardan
Aaron Marcher me@drkhsh.at
Sun, 29 Apr 2018 13:02:08 +0200
96330ff4
Remove ipv{4,6}() from todo in README
Aaron Marcher me@drkhsh.at
Sun, 29 Apr 2018 13:00:12 +0200
7a9a9b7d
ip: add OpenBSD support

ip.c already works on OpenBSD, it's just missing some headers:
Ali H. Fardan raiz@firemail.cc
Sun, 29 Apr 2018 10:55:38 +0300
97ef7c2a
Remove non-portable functions from config.def.h
Aaron Marcher me@drkhsh.at
Mon, 16 Apr 2018 19:09:07 +0200
8601c272
Add Darron Anderson to LICENSE

Thank you for your contribution.
Aaron Marcher me@drkhsh.at
Sat, 14 Apr 2018 19:44:54 +0200
c2e7d681
Remove ram_*() from README
Aaron Marcher me@drkhsh.at
Sat, 14 Apr 2018 19:44:25 +0200
88bf05e4
Add OpenBSD RAM stats
Darron Anderson darronanderson@protonmail.com
Sat, 14 Apr 2018 09:41:35 +0000
faa52bdc
Format error messages properly

Make use of strerror(errno) and format all errors equally:
function ['parameters']: error message
Aaron Marcher me@drkhsh.at
Wed, 28 Mar 2018 19:46:27 +0200
2289798b
Remove program name from error messages
Aaron Marcher me@drkhsh.at
Wed, 28 Mar 2018 18:49:27 +0200
96f3a8a5
Get rid of err.h as it is not portable

Replace warn() and warnx() with fprintf() and add <stdio.h> where
necessary.
Aaron Marcher me@drkhsh.at
Wed, 28 Mar 2018 18:26:56 +0200
aced8326
Remove unnecessary headers
Aaron Marcher me@drkhsh.at
Wed, 28 Mar 2018 18:14:08 +0200
198df15d
Remove ALSA dependency from README

ALSA is not a dependency anymore as we use /dev/mixer. The corresponding
notice about PulseAudio is thus not necessary too.
Aaron Marcher me@drkhsh.at
Mon, 26 Mar 2018 18:09:30 +0200
e79d4932
More robust preprocessor switches

Replace #ifdef with #if defined() and #elif with #elif defined() as it
should only test if it is defined or not.
Aaron Marcher me@drkhsh.at
Wed, 21 Mar 2018 12:21:37 +0100
fc5d2321
uptime: Port to OpenBSD.

In OpenBSD uptime gets fetched using sysctl now.
Aaron Marcher me@drkhsh.at
Tue, 20 Mar 2018 00:48:10 +0100
7e3f80c1
battery_perc: Port to OpenBSD.

In OpenBSD battery percentage gets fetched using apm now.
Aaron Marcher me@drkhsh.at
Mon, 19 Mar 2018 18:44:52 +0100
ad5b7c8b
README: Add list of non-portable functions
Aaron Marcher me@drkhsh.at
Sun, 18 Mar 2018 23:30:54 +0100
ebf5a350
Build Linux-only functions only on Linux
Aaron Marcher me@drkhsh.at
Sun, 18 Mar 2018 23:26:13 +0100
25bda72e
README: Add Todo
Aaron Marcher me@drkhsh.at
Sun, 18 Mar 2018 22:51:51 +0100
ff65c4a4
Merge pull request #43 from SiIky/unknown_str

Print unknown_str in case of error
Aaron Marcher me+github@drkhsh.at
Sat, 17 Feb 2018 20:00:04 +0000
8bfe4b2e
Update LICENSE year for myself.
Aaron Marcher me@drkhsh.at
Sat, 06 Jan 2018 23:40:05 +0100
fa62e819
Fix a bug in wifi_essid().

When an invalid interface name is passed to wifi_essid() it does not
close opened sockets.
Aaron Marcher me@drkhsh.at
Sat, 06 Jan 2018 23:37:09 +0100
47d0073b
Small fixes in config.mk
Aaron Marcher me@drkhsh.at
Sun, 03 Dec 2017 01:40:38 +0100
52d60c08
Update LICENSE for parazyd
Aaron Marcher me@drkhsh.at
Tue, 24 Oct 2017 11:23:27 +0200
d2988c72
Return actual percentage for wifi_perc()

Implement basic percentage calculation for wifi_perc. With this
commit, the function returns correct percentage, since the max
of what /proc/net/wireless returns is 70.
parazyd parazyd@dyne.org
Tue, 24 Oct 2017 11:03:17 +0200
7246dc43
Move components into dedicated subdirectory

This brings us a lot more tidiness.
Laslo Hunhold dev@frign.de
Sun, 24 Sep 2017 15:33:01 +0200
61e44e89
Get rid of HDR variable

The HDR variable is used for general purpose headers, which are not
given in this project. arg.h and config.h are only needed for
slstatus.c, not every component $(COM:=.c).

This also fixes a problem introduced in
e04a3853643df1c98a451969d515d8850f138bcc, where config.h is pulled into
the tarball.
Laslo Hunhold dev@frign.de
Mon, 18 Sep 2017 08:53:19 +0200
f56e50a2
Simplify Makefile
Laslo Hunhold dev@frign.de
Sun, 17 Sep 2017 23:48:11 +0200
e04a3853
Fix missing config.h in Makefile
Quentin Rameau quinq@fifth.space
Sun, 17 Sep 2017 22:31:26 +0200
11d4bec6
Added LICENSE statements to all source files
Aaron Marcher me@drkhsh.at
Sun, 17 Sep 2017 17:45:03 +0200
914440b4
Properly declare buf as extern and fix all unused-warnings
Laslo Hunhold dev@frign.de
Sun, 17 Sep 2017 17:21:54 +0200
eea99fc0
Rewrite Makefile to accomodate file split
Laslo Hunhold dev@frign.de
Sun, 17 Sep 2017 17:12:44 +0200
68206311
Split into multiple files

For multiple reasons the program is now split:
- Make future porting to OpenBSD easier
- Assign header includes to individiual functions
- Make future program extensions easier
- Recompile only changed parts
Aaron Marcher me@drkhsh.at
Sun, 17 Sep 2017 16:18:17 +0200
8e25af7d
Add blank line after setlocale

setlocale() has to be separated from the signal handling.
Aaron Marcher me@drkhsh.at
Sat, 16 Sep 2017 14:11:49 +0200
fb1f1dea
slstatus: set locale

I want my date & time printed according my locale settings.
This commit enables that

Signed-off-by: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
Kurt Van Dijck dev.kurt@vandijck-laurijssen.be
Mon, 11 Sep 2017 20:05:21 +0200
53e0c453
Added CPU iowait to README
Aaron Marcher me@drkhsh.at
Sat, 16 Sep 2017 13:54:28 +0200
72a5e52a
slstatus: add cpu_iowait

This commit introduces the cpu_iowait item, this is the percentage
of cpu time spent waiting on disks. High numbers typically indicate
that your system is not responsive due to disk IO.
This commit also avoid sleeping inside the cpu_perc and cpu_iowait
functions: waiting in either one implies lost info for the other.

Signed-off-by: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
Kurt Van Dijck dev.kurt@vandijck-laurijssen.be
Thu, 14 Sep 2017 23:58:38 +0200
57aa6a51
Deleted slstatus.png as it is unnecessary
Aaron Marcher me@drkhsh.at
Thu, 14 Sep 2017 22:20:44 +0200
b7d7ce9c
slstatus load_avg format string
Kamil Cholewiński harry666t@gmail.com
Fri, 08 Sep 2017 23:08:28 +0200
8f5219b6
Added IPv6 address function

- Renamed "ip" function to "ipv4"
- Added "ipv6" function
- Adjusted README and config.def.h accordingly
Aaron Marcher me@drkhsh.at
Mon, 14 Aug 2017 18:00:46 +0200
fcc5c683
sexy config.def.h table
Aaron Marcher me@drkhsh.at
Mon, 14 Aug 2017 14:04:21 +0200
0f7e0223
Fix a little logic error
Laslo Hunhold dev@frign.de
Mon, 14 Aug 2017 10:24:43 +0200
e1e1b1d7
Add pscanf()

This reduces a lot of equivalent code to one function call.
Laslo Hunhold dev@frign.de
Mon, 14 Aug 2017 00:34:00 +0200
796b6612
Refactor main()

We remove the hack with the sleep and global "delay"-variable and use a
monotonic clock to derive the desired monotonic properties of the tool.
Inside each function that demands a personal delay we can then just do a
nanosleep() and be done with it.
It's a shame that timespec is so ugly to work with, but there's really
no way to make it more beautiful. However, at this cost though we
finally can set the interval times in milliseconds and not only just
seconds.

We remove setlocale(), because nothing good ever came out of this
function.

Besides that we have some more code refactoring, especially in the
argument loop which saves us a bit of complexity.
Laslo Hunhold dev@frign.de
Sun, 13 Aug 2017 23:21:23 +0200
3468a6e3
Simplify signal handling a bit
Laslo Hunhold dev@frign.de
Sun, 13 Aug 2017 20:33:44 +0200
450e8e6e
Remove unnecessary prototypes
Laslo Hunhold dev@frign.de
Sun, 13 Aug 2017 20:21:49 +0200
ecf27799
Remove unnecessary blank lines after license-notice
Laslo Hunhold dev@frign.de
Sun, 13 Aug 2017 20:21:04 +0200
6a33d6c8
Fix man page .Os field
Aaron Marcher me@drkhsh.at
Sun, 13 Aug 2017 23:25:44 +0200
aa174430
Added Makefile target for distribution tarballs.
Aaron Marcher me@drkhsh.at
Sun, 13 Aug 2017 23:05:22 +0200
96334e20
Fixed man page path

According to the FHS, /usr/local/share/man is the correct man page path
in this projects's case. Set this to default in config.mk.
Aaron Marcher me@drkhsh.at
Sun, 13 Aug 2017 22:56:14 +0200
779f6112
slstatus != dmenu lol
Aaron Marcher me@drkhsh.at
Sat, 12 Aug 2017 13:37:12 +0200
c4779c9b
Removed #define for unknown_str

Debugging #define is very difficult. The performance overhead of static const
char is negligible.
Aaron Marcher me@drkhsh.at
Sat, 12 Aug 2017 13:27:30 +0200
be12b6b3
Removed #define for update interval

Debugging #define, especially in mathematical constructs is very
difficult. The performance overhead of static const int is negligible.
Aaron Marcher me@drkhsh.at
Sat, 12 Aug 2017 13:06:24 +0200
0c2ee7df
Updated LICENSE

Extended Ali H. Fardan contribution dates
Aaron Marcher me@drkhsh.at
Sat, 12 Aug 2017 12:55:53 +0200
2c114ec2
keyboard_indicators: fix segfault when -s is specified
Ali H. Fardan raiz@firemail.cc
Sat, 12 Aug 2017 07:01:13 +0300
6f011743
Fixed possible NULL-deref and removed unnecessary XOpenDisplay()

- Added a check for the return value of XOpenDisplay() in main().
  This fixes a possible NULL-deref.
- Removed unnsecessary XOpenDisplay and XCloseDisplay from
  keyboard_indicators(). The ones in main() are sufficent.
Aaron Marcher me@drkhsh.at
Fri, 11 Aug 2017 14:33:02 +0200
18140613
Add and use LEN() macro
Laslo Hunhold dev@frign.de
Fri, 11 Aug 2017 13:39:19 +0200
178c23e3
Refactor battery_state()
Laslo Hunhold dev@frign.de
Fri, 11 Aug 2017 00:17:49 +0200
6b8384ef
Reformatted LICENSE to fit 75 character width
Aaron Marcher me@drkhsh.at
Thu, 10 Aug 2017 22:43:56 +0200
00ce7a74
Print usage() when we are left with arguments
Laslo Hunhold dev@frign.de
Thu, 10 Aug 2017 22:23:55 +0200
c9d47405
Reduce -o | -n to -s

What we really want is to either output to WM_NAME or stdout. If we want
just one single line, we do slstatus | head -n 1.
Laslo Hunhold dev@frign.de
Thu, 10 Aug 2017 22:22:39 +0200
4d33c360
Remove d- and v-flags

d-flag: There's no need for that, use the &-operator or fork+exec in a
        non-shell-context. In the latter case you get the PID for free.
v-flag: If you want to find out which version of a package is installed,
        consult your package manager. That's his job.
Laslo Hunhold dev@frign.de
Thu, 10 Aug 2017 21:56:06 +0200
958c3405
Convert slstatus.1 to mandoc, simplify it and remove -h

We also change the semantics of -v to only return the version
information.
There is now no need for usage() to exit with anything other than 1.
Laslo Hunhold dev@frign.de
Thu, 10 Aug 2017 21:36:29 +0200
8dad4910
Refactor build system
Laslo Hunhold dev@frign.de
Thu, 10 Aug 2017 21:32:10 +0200
d35e518e
New README in plain text
Aaron Marcher me@drkhsh.at
Thu, 10 Aug 2017 21:49:37 +0200
b6fb77c7
Removed TODO.md
Aaron Marcher me@drkhsh.at
Thu, 10 Aug 2017 21:10:17 +0200
5134a480
Removed CONTRIBUTING.md
Aaron Marcher me@drkhsh.at
Thu, 10 Aug 2017 21:08:53 +0200
b3eed601
Moved contributors to LICENSE
Aaron Marcher me@drkhsh.at
Thu, 10 Aug 2017 21:06:48 +0200
dad6dc63
Copyright sign (C) is not required in LICENSE

According to https://opensource.org/licenses/ISC
Aaron Marcher me@drkhsh.at
Thu, 10 Aug 2017 20:32:14 +0200
be4cffef
Removed .gitignore from repository

A file outside the repository (.git/info/exclude) can replace this and
suits better for this usecase.
Aaron Marcher me@drkhsh.at
Thu, 10 Aug 2017 20:30:52 +0200
999cf004
new arg.h version by frign
Aaron Marcher me@drkhsh.at
Thu, 10 Aug 2017 11:31:57 +0200
4b4b2ac0
add num_files() function for maildirs ;)
aaron marcher me@drkhsh.at
Sun, 06 Aug 2017 15:02:16 +0200
ad39aa01
updated readme
Aaron Marcher info@nulltime.net
Tue, 13 Jun 2017 00:11:35 +0200
1c8aa531
check for fgets/fscanf return values
Aaron Marcher info@nulltime.net
Tue, 13 Jun 2017 00:06:56 +0200
597cdc6b
use a static buffer instead of dynamic memory
Aaron Marcher info@nulltime.net
Tue, 13 Jun 2017 00:06:04 +0200
abbaa7af
remove format characters from stat functions
Aaron Marcher info@nulltime.net
Mon, 12 Jun 2017 23:59:21 +0200
832b21ca
add cpu_freq function
Aaron Marcher info@nulltime.net
Mon, 12 Jun 2017 23:56:21 +0200
259e967c
add battery_power function
Aaron Marcher info@nulltime.net
Mon, 12 Jun 2017 23:55:27 +0200
870d68d4
added option to output only once and exit afterwards
Aaron Marcher info@nulltime.net
Thu, 11 May 2017 19:06:45 +0200
ac1a57ec
enable stack protector and compile to position independent executable
Aaron Marcher info@nulltime.net
Thu, 20 Apr 2017 22:33:10 +0200
d144c8de
simplified and improved vol_perc()
Aaron Marcher info@nulltime.net
Thu, 20 Apr 2017 22:30:04 +0200
c288663e
fix overflow in run_command()
Aaron Marcher info@nulltime.net
Thu, 20 Apr 2017 22:20:19 +0200
b2714032
username(): get rid of unneeded uid variable
Aaron Marcher info@nulltime.net
Thu, 20 Apr 2017 22:18:24 +0200
95ceafca
Merge pull request #39 from stoeckmann/fgets

On success, fgets always terminates the result.
Aaron Marcher info@nulltime.net
Thu, 20 Apr 2017 22:14:56 +0200
1289bdb7
Merge pull request #38 from stoeckmann/terminating-nul

Fixed out of boundary write on long lines.
Aaron Marcher info@nulltime.net
Sun, 02 Apr 2017 15:27:09 +0200
cceeec0e
loading thresholds state
Aaron Marcher info@nulltime.net
Thu, 30 Mar 2017 17:32:20 +0200
b11dd2db
Fixed XCloseDisplay() which is not reached in keyboard_indicators()
Aaron Marcher info@nulltime.net
Mon, 23 Jan 2017 21:01:41 +0100
823f2d04
Added keyboard_indicators (Fixes #31)
Aaron Marcher info@nulltime.net
Mon, 16 Jan 2017 12:10:56 +0100
3f976aab
Makefile fix and vol_perc fix for mute
Aaron Marcher info@nulltime.net
Mon, 09 Jan 2017 12:05:29 +0100
a3cb24c4
simplified Makefile
Aaron Marcher info@nulltime.net
Mon, 09 Jan 2017 09:29:58 +0100
09c3ffe3
small Makefile tweak
Aaron Marcher info@nulltime.net
Mon, 09 Jan 2017 09:23:17 +0100
bb877365
Makefile: Added back config.h handling in Makefile
Aaron Marcher info@nulltime.net
Mon, 09 Jan 2017 09:21:18 +0100
98d655c8
Makefile: Fixes #35
Aaron Marcher info@nulltime.net
Mon, 09 Jan 2017 08:24:26 +0100
99bc2585
todo
Aaron Marcher info@nulltime.net
Sat, 07 Jan 2017 22:34:45 +0100
0d1f19d7
removed ./extern/
Aaron Marcher info@nulltime.net
Sat, 07 Jan 2017 22:33:28 +0100
688e2e78
removed strlcat dependency (was used only once)
Aaron Marcher info@nulltime.net
Sat, 07 Jan 2017 22:31:46 +0100
32bb9245
got rid of concat.h
Aaron Marcher info@nulltime.net
Sat, 07 Jan 2017 22:01:49 +0100
d1915f0d
saner makefile: cleaner, simpler, suckless
Aaron Marcher info@nulltime.net
Sat, 07 Jan 2017 21:49:10 +0100
38479117
happy new year!
Aaron Marcher info@nulltime.net
Sat, 07 Jan 2017 21:28:22 +0100
8a293747
run_command: strlen() will not function if string is not null terminated
Aaron Marcher info@nulltime.net
Sat, 07 Jan 2017 21:19:40 +0100
965a71d6
consistent coding style: usage() declaration, eval is a constant
Aaron Marcher info@nulltime.net
Fri, 30 Dec 2016 23:13:21 +0100
2b148bf2
Merge pull request #34 from parazyd/master

refactor vol_perc to not depend on alsa libraries
Aaron Marcher info@nulltime.net
Fri, 30 Dec 2016 23:01:14 +0100
8fa62297
why releases for such a small project? useless and overhead!
Aaron Marcher info@nulltime.net
Thu, 29 Dec 2016 23:36:05 +0100
b68925db
#undef strlcpy not needed anymore
Aaron Marcher info@nulltime.net
Thu, 29 Dec 2016 23:30:53 +0100
d7fbcb35
tested wifi
Aaron Marcher info@nulltime.net
Thu, 29 Dec 2016 23:30:17 +0100
e3c9a6f9
Merge pull request #32 from R41z/master

several bugfixes and general improvements, see commits below.
Aaron Marcher info@nulltime.net
Thu, 29 Dec 2016 23:27:57 +0100
7392dbab
kernel_release() coding style and position in code fix
Aaron Marcher info@nulltime.net
Wed, 28 Dec 2016 23:59:19 +0100
1a143566
Merge pull request #30 from TheMRod/master

Add a "uname -r" feature to see which kernel is running
Aaron Marcher info@nulltime.net
Wed, 16 Nov 2016 21:20:26 +0100
bcd5732b
Merge pull request #25 from jodizzle/dev/swap

Add functions for measuring swap
Aaron Marcher info@nulltime.net
Fri, 28 Oct 2016 16:27:19 +0200
59ed3b6d
Merge pull request #24 from jodizzle/feat/mute

Restore "mute" message
Aaron Marcher info@nulltime.net
Thu, 13 Oct 2016 12:15:18 +0200
97c745e1
Merge pull request #23 from R41z/master

get rid of unused variable (silly gcc did not report that error)
Aaron Marcher info@nulltime.net
Wed, 12 Oct 2016 22:01:46 +0200
8830aeef
added quinq to contributors
Aaron Marcher info@nulltime.net
Mon, 10 Oct 2016 20:05:33 +0200
e1b89581
add setlocale() (mostly for datetime function)
Aaron Marcher info@nulltime.net
Mon, 10 Oct 2016 18:58:06 +0200
3971c1f4
check daemon() return value
Aaron Marcher info@nulltime.net
Mon, 10 Oct 2016 18:52:46 +0200
6890a27a
fixed run_command()
Aaron Marcher info@nulltime.net
Mon, 10 Oct 2016 09:19:44 +0200
5a70f920
fixed run_command()
Aaron Marcher info@nulltime.net
Mon, 10 Oct 2016 09:02:24 +0200
cc1bb3a3
removed unnecessary fp, shorter return 0 and fixed compiler warning in vol_perc
Aaron Marcher info@nulltime.net
Sun, 09 Oct 2016 14:06:04 +0200
5e7aa2a3
Merge pull request #20 from R41z/master

fix division by zero in vol_perc, and hostname() rewrite
Aaron Marcher info@nulltime.net
Sun, 09 Oct 2016 13:50:02 +0200
6239e5de
added name to LICENSE
Aaron Marcher info@nulltime.net
Wed, 05 Oct 2016 22:56:25 +0200
3a3a3e41
better default config.h
Aaron Marcher info@nulltime.net
Wed, 05 Oct 2016 11:40:36 +0200
a2d2e801
3.0
Aaron Marcher info@nulltime.net
Mon, 19 Sep 2016 11:17:51 +0200
c5ace949
braces for one line statements in smprintf()
Aaron Marcher info@nulltime.net
Sun, 18 Sep 2016 22:01:44 +0200
bad8dc68
shorter copyright notice and moved back VERSION and _GNU_SOURCE as the man page version number fails
Aaron Marcher info@nulltime.net
Sun, 18 Sep 2016 22:00:50 +0200
237a7720
Merge pull request #19 from R41z/master

several changes
Aaron Marcher info@nulltime.net
Sun, 18 Sep 2016 21:44:48 +0200
fd36f65c
updated man page according to readme
Aaron Marcher info@nulltime.net
Sun, 18 Sep 2016 21:08:21 +0200
fad39093
added -v to manpage
Aaron Marcher info@nulltime.net
Sun, 18 Sep 2016 21:07:02 +0200
915eeb8b
lol, dwm != slstatus in manpage :D
Aaron Marcher info@nulltime.net
Sun, 18 Sep 2016 21:06:28 +0200
dd0f0cd3
README.md reloaded
Aaron Marcher info@nulltime.net
Sun, 18 Sep 2016 17:51:25 +0200
0fe8e5a9
suckless coding style -> added back function prototypes argument variable names
Aaron Marcher info@nulltime.net
Sun, 18 Sep 2016 17:26:01 +0200
d1423010
config.mk comment about -Wno-unused-functions
Aaron Marcher info@nulltime.net
Sun, 18 Sep 2016 17:22:12 +0200
cfa0d9e8
optimization
Aaron Marcher info@nulltime.net
Sun, 18 Sep 2016 17:15:50 +0200
14749b6c
added -v command line option
Aaron Marcher info@nulltime.net
Sun, 18 Sep 2016 17:03:53 +0200
dcc0cdde
simpler usage
Aaron Marcher info@nulltime.net
Sun, 18 Sep 2016 16:57:55 +0200
db07244c
do not exit on failed smprintf
Aaron Marcher info@nulltime.net
Sun, 18 Sep 2016 16:54:46 +0200
2fdb2ede
added man page
Aaron Marcher info@nulltime.net
Sat, 17 Sep 2016 22:51:59 +0200
4a7aba51
added man page
Aaron Marcher info@nulltime.net
Sat, 17 Sep 2016 22:51:49 +0200
fd0bb713
added optimization back (removed it for debugging some time ago)
Aaron Marcher info@nulltime.net
Sat, 17 Sep 2016 22:03:56 +0200
9477f3b1
n/a for run_command()
Aaron Marcher info@nulltime.net
Sat, 17 Sep 2016 18:16:27 +0200
c8926634
fuck newlines
Aaron Marcher info@nulltime.net
Sat, 17 Sep 2016 18:10:26 +0200
18f7d999
removed TODO.md
Aaron Marcher info@nulltime.net
Sat, 17 Sep 2016 18:08:31 +0200
37959ca5
moved headers to extern
Aaron Marcher info@nulltime.net
Sat, 17 Sep 2016 18:07:03 +0200
d73118ea
shorter names
Aaron Marcher info@nulltime.net
Sat, 17 Sep 2016 17:06:06 +0200
2e012d53
only open and close display if output type is dwm
Aaron Marcher info@nulltime.net
Sat, 17 Sep 2016 16:53:45 +0200
4dcba6b7
coding style fixes + better var names
Aaron Marcher info@nulltime.net
Sat, 17 Sep 2016 16:51:21 +0200
87eae6db
added daemonization, output possibility to console (for other programs) and moved the code to set WM_NAME to its own function as it is needed two times
Aaron Marcher info@nulltime.net
Fri, 16 Sep 2016 23:31:24 +0200
887b9bd3
fixed run_command()
Aaron Marcher info@nulltime.net
Wed, 14 Sep 2016 18:42:51 +0200
ad03218f
Merge pull request #18 from R41z/master

simplified run_command()
Aaron Marcher info@nulltime.net
Wed, 14 Sep 2016 16:47:28 +0200
5609b9d9
Merge pull request #17 from R41z/master

improved hostname()
Aaron Marcher info@nulltime.net
Wed, 14 Sep 2016 11:27:19 +0200
6edc9599
do not overwrite config.h if config.def.h changes
Aaron Marcher info@nulltime.net
Wed, 14 Sep 2016 11:08:37 +0200
1ad9f250
hostname() null terminaiton subtraction *is* needed
Aaron Marcher info@nulltime.net
Wed, 14 Sep 2016 11:04:24 +0200
bca9b524
Merge pull request #16 from R41z/master

several improvements && memory leak fix.
Aaron Marcher info@nulltime.net
Wed, 14 Sep 2016 10:58:14 +0200
f1310415
battery_state() function added
Aaron Marcher info@nulltime.net
Tue, 13 Sep 2016 22:03:36 +0200
7aad78bd
fixed vol_perc() typo and added % sign again
Aaron Marcher info@nulltime.net
Tue, 13 Sep 2016 21:11:11 +0200
87c1377b
simplified vol_perc() (and with that config.def.h is super clean)
Aaron Marcher info@nulltime.net
Tue, 13 Sep 2016 21:08:44 +0200
74b6e340
lol, battery_perc() is even simpler, fuck this shit :D
Aaron Marcher info@nulltime.net
Tue, 13 Sep 2016 21:05:49 +0200
2d1bbf0d
simplified battery_perc() a lot and removed useless options from config.def.h
Aaron Marcher info@nulltime.net
Tue, 13 Sep 2016 20:54:45 +0200
60df4f0f
loop's not needed anymore
Aaron Marcher info@nulltime.net
Tue, 13 Sep 2016 19:35:54 +0200
98e73240
set old WM_NAME content before exiting
Aaron Marcher info@nulltime.net
Tue, 13 Sep 2016 19:34:25 +0200
ba2947ae
sighandle forgot const
Aaron Marcher info@nulltime.net
Tue, 13 Sep 2016 19:21:54 +0200
67d3f9c5
signal handling to exit gracefully + small coding style fixes
Aaron Marcher info@nulltime.net
Tue, 13 Sep 2016 19:09:01 +0200
a1c962f8
simplify status_string clearing
Aaron Marcher info@nulltime.net
Tue, 13 Sep 2016 18:57:56 +0200
75b18533
Fixes issue #15. Forgot to close() a socket in wifi_essid()...
Aaron Marcher info@nulltime.net
Tue, 13 Sep 2016 18:54:15 +0200
d19d4aa2
coding style (global variables)
Aaron Marcher info@nulltime.net
Mon, 12 Sep 2016 12:12:11 +0200
c0647e94
Merge pull request #14 from R41z/master

cpu_perc() workaround
Aaron Marcher info@nulltime.net
Mon, 12 Sep 2016 11:47:48 +0200
d5fb46e6
fixed wifi_perc() typo
Aaron Marcher info@nulltime.net
Mon, 12 Sep 2016 11:28:54 +0200
f901f4ce
added my fancy icon
Aaron Marcher info@nulltime.net
Fri, 09 Sep 2016 21:12:13 +0200
217da011
brought back update interval
Aaron Marcher info@nulltime.net
Fri, 09 Sep 2016 19:26:06 +0200
81997b32
removed more unneeded comments
Aaron Marcher info@nulltime.net
Fri, 09 Sep 2016 19:21:26 +0200
545f1560
fixed username function (wtf happened here?)
Aaron Marcher info@nulltime.net
Fri, 09 Sep 2016 19:19:46 +0200
98f3985d
fixed run_command behaviour for emtpy command output (uninitialized)
Aaron Marcher info@nulltime.net
Fri, 09 Sep 2016 19:18:14 +0200
3bfa5fe6
coding style fixes
Aaron Marcher info@nulltime.net
Fri, 09 Sep 2016 19:15:43 +0200
7710c9ed
removed that status_reset (we will do that with signals) and loop.sh (we wont need it)
Aaron Marcher info@nulltime.net
Fri, 09 Sep 2016 19:12:08 +0200
6518f41b
Merge branch 'R41z-master'
Aaron Marcher info@nulltime.net
Fri, 09 Sep 2016 19:07:25 +0200
5c86bbd6
remove screenshot
Aaron Marcher info@nulltime.net
Thu, 18 Aug 2016 15:03:43 +0200
7d8f5f48
update sloc count in readme
Aaron Marcher info@nulltime.net
Thu, 18 Aug 2016 15:02:51 +0200
a149ec06
remove todo item
Aaron Marcher info@nulltime.net
Thu, 18 Aug 2016 15:01:19 +0200
85dd971f
suckless coding style fix -> remove slstatus.h
Aaron Marcher info@nulltime.net
Thu, 18 Aug 2016 14:55:05 +0200
c15e66ce
added all functions to readme
Aaron Marcher info@nulltime.net
Thu, 18 Aug 2016 13:45:06 +0200
85a2b9b7
added uptime function
Aaron Marcher info@nulltime.net
Thu, 18 Aug 2016 13:43:18 +0200
83c98554
load avg
Aaron Marcher info@nulltime.net
Thu, 18 Aug 2016 13:30:45 +0200
1d43e2f2
added configuration option for n/a text
Aaron Marcher info@nulltime.net
Thu, 18 Aug 2016 13:03:42 +0200
f549d018
Added \n to all error messages.
Aaron Marcher info@nulltime.net
Tue, 16 Aug 2016 17:40:25 +0200
f9748dcc
Removed the debug gcc flags
Aaron Marcher info@nulltime.net
Tue, 16 Aug 2016 17:34:50 +0200
ad8ab20c
Formatting commit :(

I know formatting commits suck... And I try to avoid them.

But this commit was absolutely necessary... The coding style in this
program was not ok and not the same over the whole program.

The commit is hard to read, but this is what I changed:
- Tabs for indentation instead of spaces
- Same style over the whole program (suckless style)
Aaron Marcher info@nulltime.net
Tue, 16 Aug 2016 11:41:43 +0200
ec353761
simplified ram function
Aaron Marcher info@nulltime.net
Mon, 15 Aug 2016 16:40:56 +0200
85db24fe
simplified wifi_essid by removing one malloc()
Aaron Marcher info@nulltime.net
Mon, 15 Aug 2016 16:28:02 +0200
58c16312
this project is now licensed under the ISC license
Aaron Marcher info@nulltime.net
Mon, 15 Aug 2016 16:10:42 +0200
093f39df
added wifi essid
Aaron Marcher info@nulltime.net
Mon, 15 Aug 2016 14:43:29 +0200
4170970c
fixed strcat null possibility in main()
Aaron Marcher info@nulltime.net
Mon, 15 Aug 2016 13:08:34 +0200
df928892
fixed strlen-bomb in run_command
Aaron Marcher info@nulltime.net
Mon, 15 Aug 2016 12:59:45 +0200
086a70cd
fixed memleak in datetime()
Aaron Marcher info@nulltime.net
Mon, 15 Aug 2016 12:43:43 +0200
a8d5bde6
void argument main()
Aaron Marcher info@nulltime.net
Mon, 15 Aug 2016 12:34:45 +0200
9078fb35
Fixed alsa function + datetime function
Aaron Marcher info@nulltime.net
Mon, 15 Aug 2016 12:26:00 +0200
f6f0c895
Added shell command function
Aaron Marcher info@nulltime.net
Mon, 15 Aug 2016 12:23:35 +0200
3c1a0391
revised readme
Aaron Marcher info@nulltime.net
Thu, 30 Jun 2016 18:36:24 +0200
2b8e2047
revised readme
Aaron Marcher info@nulltime.net
Thu, 30 Jun 2016 18:29:11 +0200
456be7ad
README update (included information)
Aaron Marcher info@nulltime.net
Tue, 14 Jun 2016 19:19:25 +0200
16716dd1
added, username, gid, uid
Aaron Marcher info@nulltime.net
Mon, 13 Jun 2016 18:49:50 +0200
fb524b60
added disk functions for details
Aaron Marcher info@nulltime.net
Fri, 10 Jun 2016 19:13:13 +0200
688c2d43
added memory values ram functions
Aaron Marcher info@nulltime.net
Fri, 10 Jun 2016 18:46:47 +0200
c7f3a407
fixed hostname function and added HOST_NAME_MAX limit
Aaron Marcher info@nulltime.net
Fri, 10 Jun 2016 18:22:05 +0200
2e72b212
hostname function
Aaron Marcher info@nulltime.net
Fri, 10 Jun 2016 15:53:07 +0200
67203c66
added ip address function
Aaron Marcher info@nulltime.net
Wed, 08 Jun 2016 09:42:32 +0200
5a943fa5
added entropy
Aaron Marcher info@nulltime.net
Fri, 03 Jun 2016 13:04:15 +0200
bf2cdd10
Added icon to TODO.md
Aaron Marcher info@nulltime.net
Sun, 20 Mar 2016 17:07:00 +0100
d5d86247
typo license != license.md :P
Aaron Marcher info@nulltime.net
Sun, 20 Mar 2016 14:20:22 +0100
27b9139d
Changes to documentation and new screenshot.

- Better README.md
- Headlines in all files
- CONTRIBUTING.md
- New screenshot
Aaron Marcher info@nulltime.net
Sun, 20 Mar 2016 14:18:05 +0100
02af858a
Easier info function names

All the info function names started with "get_", which I removed to make
it easier for the user to configure the program to its needs.
Additionally I renamed some functions (e.g. get_ram_usage) to better
names, making it easier to extend the program with ram usage / total
functions.
Aaron Marcher info@nulltime.net
Fri, 18 Mar 2016 16:15:05 +0100
09673777
Merge pull request #10 from sahne/master

Fix some memory leaks
Aaron Marcher info@nulltime.net
Thu, 17 Mar 2016 19:15:17 +0100
bc12a40d
added license info to slstatus.h
Aaron Marcher info@nulltime.net
Wed, 16 Mar 2016 09:01:07 +0100
ace0aa15
header
Aaron Marcher info@nulltime.net
Wed, 16 Mar 2016 08:45:19 +0100
291e2bcb
removed from todo
Aaron Marcher info@nulltime.net
Tue, 15 Mar 2016 11:28:14 +0100
b1ff7242
added some todos
Aaron Marcher info@nulltime.net
Tue, 15 Mar 2016 11:21:36 +0100
d3172a49
disk usage in README.md
Aaron Marcher info@nulltime.net
Mon, 14 Mar 2016 20:25:56 +0100
b176d0a2
completely new system: only values in config file get updated + cleaner code
Aaron Marcher info@nulltime.net
Mon, 14 Mar 2016 20:17:14 +0100
a97e8439
whitespace error
Aaron Marcher info@nulltime.net
Fri, 11 Mar 2016 13:15:17 +0100
11cc0bce
removed todo
Aaron Marcher info@nulltime.net
Fri, 11 Mar 2016 13:12:08 +0100
6624985c
fixed disk percent
Aaron Marcher info@nulltime.net
Fri, 11 Mar 2016 13:11:15 +0100
faae8292
Merge pull request #9 from sahne/master

Add diskusage support
Aaron Marcher info@nulltime.net
Fri, 11 Mar 2016 13:02:26 +0100
db63d3dc
Update README.md
Aaron Marcher info@nulltime.net
Thu, 10 Mar 2016 18:01:39 +0100
94921691
Create TODO.md
Aaron Marcher info@nulltime.net
Thu, 10 Mar 2016 18:00:40 +0100
ec320f42
Merge pull request #8 from Vlaix/master

Fixed locale defaulting to English
Aaron Marcher info@nulltime.net
Thu, 10 Mar 2016 17:29:20 +0100
d4d2646f
added update_interval check to config_check()
Aaron Marcher info@nulltime.net
Thu, 10 Mar 2016 15:50:35 +0100
83eae75d
coding style notice in README.md
Aaron Marcher info@nulltime.net
Thu, 10 Mar 2016 15:12:09 +0100
7c16dce6
added sahne to contributors
Aaron Marcher info@nulltime.net
Thu, 10 Mar 2016 15:01:28 +0100
1b65dec3
fixed some small things (update_interval) interferes with get_cpu_usage() and reordered)
Aaron Marcher info@nulltime.net
Thu, 10 Mar 2016 14:59:37 +0100
e046ee18
Merge pull request #6 from sahne/master

minor cleanups and sanity checks
Aaron Marcher info@nulltime.net
Thu, 10 Mar 2016 14:50:11 +0100
83e84beb
simplified config.def.h
Aaron Marcher info@nulltime.net
Thu, 10 Mar 2016 11:11:39 +0100
175844da
Merge pull request #5 from Vlaix/master

Fixed small buffer in get_datetime()
Aaron Marcher info@nulltime.net
Thu, 10 Mar 2016 10:59:59 +0100
f64bf0f0
better screenshot
Aaron Marcher info@nulltime.net
Thu, 10 Mar 2016 10:29:22 +0100
11e9491f
small changes (var names)
Aaron Marcher info@nulltime.net
Thu, 10 Mar 2016 08:37:20 +0100
2d1b9211
starting in README.md
Aaron Marcher info@nulltime.net
Thu, 10 Mar 2016 07:51:04 +0100
6a0ae11a
put everything in logical order
Aaron Marcher info@nulltime.net
Wed, 09 Mar 2016 16:30:52 +0100
8286bd8a
Merge pull request #4 from Vlaix/ram

Changed RAM calculation formula.
Aaron Marcher info@nulltime.net
Wed, 09 Mar 2016 13:08:55 +0100
2fb476aa
contributors
Aaron Marcher info@nulltime.net
Wed, 09 Mar 2016 11:26:19 +0100
b5813a7f
changed to easier variable names
Aaron Marcher info@nulltime.net
Wed, 09 Mar 2016 11:21:35 +0100
8894244c
changed to 4 spaces indentation (2 are not enough)
Aaron Marcher info@nulltime.net
Wed, 09 Mar 2016 11:13:27 +0100
ff6c029d
Merge pull request #3 from Vlaix/master

Fixed broken wifi
Aaron Marcher info@nulltime.net
Wed, 09 Mar 2016 10:53:27 +0100
16d01e8d
Merge pull request #2 from pfannkuchengesicht/master

fixed some memory leaks
Aaron Marcher info@nulltime.net
Wed, 09 Mar 2016 07:45:51 +0100
526955ec
fixed tabs xD
Aaron Marcher info@nulltime.net
Tue, 08 Mar 2016 18:39:18 +0100
4c67ce86
fixed typo in README.md (jpg <-> png)
Aaron Marcher info@nulltime.net
Tue, 08 Mar 2016 18:18:47 +0100
b415783c
added screenshot
Aaron Marcher info@nulltime.net
Tue, 08 Mar 2016 18:17:50 +0100
570ebe34
variable names
Aaron Marcher info@nulltime.net
Mon, 07 Mar 2016 10:08:04 +0100
cc85bcc4
commented and reordered
Aaron Marcher info@nulltime.net
Mon, 07 Mar 2016 10:00:02 +0100
6b2b839c
revised everything
Aaron Marcher info@nulltime.net
Sat, 05 Mar 2016 14:07:02 +0100
864f2246
added config.def.h handling and fixed typo
Aaron Marcher info@nulltime.net
Fri, 04 Mar 2016 18:36:47 +0100
94ea78f0
initial commit
Aaron Marcher info@nulltime.net
Fri, 04 Mar 2016 18:07:42 +0100
47a0e8de
Initial commit
Aaron Marcher info@nulltime.net
Fri, 04 Mar 2016 10:46:19 +0100
12521e4e
fixed some memory leaks
Roy Freytag rfreytag@hs-mittweida.de
Tue, 08 Mar 2016 20:55:07 +0100
3b6f51f8
Fixed broken wifi
Fixed indentation
Removed trailig white spaces
Vincent Loupmon vincentloupmon@gmail.com
Wed, 09 Mar 2016 10:19:10 +0100
e241dbeb
Changed RAM calculation formula.

Former : MemTotal - MemAvailable
New : (MemTotal - MemFree) - (Buffers + Cached)
Vincent Loupmon vincentloupmon@gmail.com
Wed, 09 Mar 2016 12:38:22 +0100
790e150a
Fixed small buffer in get_datetime()

The buffer being hardcoded to 19 (the size expected from the default time format),
strftime() would fail on any format returning a longer buffer.
Changed it from 19 to 64 to accomodate longer formats.
Vincent Loupmon vincentloupmon@gmail.com
Thu, 10 Mar 2016 10:53:14 +0100
50219004
return n/a instead of exiting if a specific value cannot be read
Daniel Walter d.walter@0x90.at
Thu, 10 Mar 2016 13:09:24 +0100
b51721c6
add config checks on startup for better error handling
Daniel Walter d.walter@0x90.at
Thu, 10 Mar 2016 12:11:46 +0100
5295629c
add update_interval

add a short sleep to reduce load
Daniel Walter d.walter@0x90.at
Thu, 10 Mar 2016 11:55:42 +0100
410ba38a
make config.h target depending on config.def.h
Daniel Walter d.walter@0x90.at
Thu, 10 Mar 2016 11:55:12 +0100
046e273a
simplify smprintf by using vasprintf
Daniel Walter d.walter@0x90.at
Thu, 10 Mar 2016 11:49:48 +0100
552ba7fd
Fixed locale defaulting to English

Changed get_datetime() a bit so it respects the user-configured locale (to use time formats with strings for days, months etc.)

Same commit as last time, except it merges.
Vincent Loupmon vincentloupmon@gmail.com
Thu, 10 Mar 2016 16:50:32 +0100
21afb5a8
Add diskusage support

add support to show used disk for a given mountpoint
Daniel Walter d.walter@0x90.at
Fri, 11 Mar 2016 12:18:23 +0100
67f61b83
Fix some memory leaks
Daniel Walter dwalter@sigma-star.at
Thu, 17 Mar 2016 19:12:47 +0100
9b2dc253
use warn[x]() instead of long fprintf()s
Ali H. Fardan raiz@firemail.cc
Thu, 08 Sep 2016 04:45:00 +0300
2afea979
used ccat() from concat.h for string concatenation
Ali H. Fardan raiz@firemail.cc
Thu, 08 Sep 2016 04:31:49 +0300
113979e5
fixed some mistakes
Ali H. Fardan raiz@firemail.cc
Mon, 05 Sep 2016 02:28:18 +0300
720328ce
what kind of weed is that?
Ali H. Fardan raiz@firemail.cc
Mon, 05 Sep 2016 02:17:30 +0300
b9b6486c
bringed back the old config.mk
Ali H. Fardan raiz@firemail.cc
Mon, 05 Sep 2016 01:40:47 +0300
a66b73f5
bringed back the old config.mk
Ali H. Fardan raiz@firemail.cc
Mon, 05 Sep 2016 01:40:10 +0300
a4beda8e
bringed back the loop
Ali H. Fardan raiz@firemail.cc
Mon, 05 Sep 2016 01:21:03 +0300
52d19f95
imported a new vol_perc() function, this should fix #12 (UNTESTED)
Ali H. Fardan raiz@firemail.cc
Mon, 05 Sep 2016 01:18:55 +0300
9fa858da
added a tool for resetting the status bar && worked around some issues && removed the makefile (we need a better one)
Ali H. Fardan raiz@firemail.cc
Mon, 05 Sep 2016 01:13:48 +0300
1654efe1
config.mk cleanup
Ali H. Fardan raiz@firemail.cc
Mon, 05 Sep 2016 00:56:22 +0300
d3d8b8ee
added daemonization support
Ali H. Fardan raiz@firemail.cc
Sun, 04 Sep 2016 00:10:49 +0300
de4f20ac
removed UPDATE_INTERVAL, it is neat to have it but removing it is a tradeoff worth making, because the clock would act weird if this used to work with cpu_perc().
Ali H. Fardan raiz@firemail.cc
Sat, 03 Sep 2016 21:43:05 +0300
b650c438
removed setstatus() && simplified main()
Ali H. Fardan raiz@firemail.cc
Fri, 02 Sep 2016 22:13:58 +0300
d1ae2e78
NOTREACHED comment
Ali H. Fardan raiz@firemail.cc
Thu, 01 Sep 2016 21:54:00 +0300
d3a212da
simplified gid()
Ali H. Fardan raiz@firemail.cc
Thu, 01 Sep 2016 21:51:32 +0300
2f8335ab
simplified uid() and fixed username()
Ali H. Fardan raiz@firemail.cc
Thu, 01 Sep 2016 21:35:32 +0300
82514163
removed unnecessary typecast and added more comments
Ali H. Fardan raiz@firemail.cc
Thu, 01 Sep 2016 21:15:40 +0300
9e92d41d
removed unneeded headers
Ali H. Fardan raiz@firemail.cc
Thu, 01 Sep 2016 21:02:17 +0300
aa70b663
opened the file before the path concatenates, what an idiot
Ali H. Fardan raiz@firemail.cc
Wed, 31 Aug 2016 14:29:27 +0300
5e4dc85b
forgot to give entropy() some candy too
Ali H. Fardan raiz@firemail.cc
Wed, 31 Aug 2016 06:10:53 +0300
cd3c0849
slow down boy! you opened the file too early!
Ali H. Fardan raiz@firemail.cc
Wed, 31 Aug 2016 06:00:14 +0300
b800eb21
removed vol function from the default config file
Ali H. Fardan raiz@firemail.cc
Wed, 31 Aug 2016 02:17:42 +0300
0aefd57f
got rid of conditional assignments && improved the error messages to output more info && added bound checks for fscanf() in hostname() (a dirty hack) && fixed a bug or two && some tiny style corrections
Ali H. Fardan raiz@firemail.cc
Tue, 30 Aug 2016 21:50:40 +0300
5829cee2
used a different implementation of smprintf() imported from dwmstatus
Ali H. Fardan raiz@firemail.cc
Sun, 28 Aug 2016 19:27:01 +0300
94a62b86
worked around the buffer overrun in smprintf()
Ali H. Fardan raiz@firemail.cc
Sun, 28 Aug 2016 18:19:53 +0300
1d257999
removed heap dependency in datetime() and simplified the function
Ali H. Fardan raiz@firemail.cc
Sun, 28 Aug 2016 16:39:04 +0300
25eb9ff3
FIXME: buffer overflow warning
Ali H. Fardan raiz@firemail.cc
Sun, 28 Aug 2016 16:30:12 +0300
24c4134d
removed a misplaced ';'
Ali H. Fardan raiz@firemail.cc
Sun, 28 Aug 2016 16:24:19 +0300
47ddf938
used constant string literals && remote initialization to  in battery_perc() && trying to fix possible buffer overflow
Ali H. Fardan raiz@firemail.cc
Sun, 28 Aug 2016 16:20:50 +0300
674602c6
grammar correction
Ali H. Fardan raiz@firemail.cc
Sun, 28 Aug 2016 15:33:31 +0300
447283fd
removing typecasts for pcm_mixer cause more issues than before
Ali H. Fardan raiz@firemail.cc
Thu, 25 Aug 2016 23:26:17 +0300
ee5337ba
typofix && another update
Ali H. Fardan raiz@firemail.cc
Tue, 23 Aug 2016 14:16:45 +0300
5b609747
another update to README
Ali H. Fardan raiz@firemail.cc
Tue, 23 Aug 2016 14:13:23 +0300
b79837b0
README update
Ali H. Fardan raiz@firemail.cc
Tue, 23 Aug 2016 14:11:55 +0300
f9f72a06
removed unnecessary typecasts (might be a reason for snd_mixer_selem_get_playback_volume_range bug
Ali H. Fardan raiz@firemail.cc
Tue, 23 Aug 2016 13:27:42 +0300
ff013b5f
status_string can hold 4096 bytes now
Ali H. Fardan raiz@firemail.cc
Sun, 21 Aug 2016 16:00:34 +0300
6f31ca6c
fixed compiler warnings in a better way
Ali H. Fardan raiz@firemail.cc
Sun, 21 Aug 2016 15:43:57 +0300
8e039b9d
corrected the time format
Ali H. Fardan raiz@firemail.cc
Sun, 21 Aug 2016 15:21:20 +0300
fc5ae33f
rm .config.h.swp
Ali H. Fardan raiz@firemail.cc
Sun, 21 Aug 2016 15:20:07 +0300
f65fb9bc
fixed the code, works now
Ali H. Fardan raiz@firemail.cc
Sun, 21 Aug 2016 15:19:45 +0300
0da2af8c
Added myself to CONTRIBUTORS.md by drkh5h's request
Ali H. Fardan raiz@firemail.cc
Sun, 21 Aug 2016 12:04:01 +0300
b4f55e71
(void)ed the prototypes
Ali H. Fardan raiz@firemail.cc
Sun, 21 Aug 2016 12:00:51 +0300
46b6876d
set local function as static
Ali H. Fardan raiz@firemail.cc
Sun, 21 Aug 2016 11:28:42 +0300
73ec65a8
-Wextra
Ali H. Fardan raiz@firemail.cc
Sun, 21 Aug 2016 11:10:37 +0300
2e1eb518
the code describes itself, there is no need to write stories in /* */
Ali H. Fardan raiz@firemail.cc
Sun, 21 Aug 2016 11:10:14 +0300
18538845
braces are unneeded for one-liner if()/while()
Ali H. Fardan raiz@firemail.cc
Sun, 21 Aug 2016 00:28:36 +0300
e1ae7d3b
added bounds checking via secure strl*() routines
Ali H. Fardan raiz@firemail.cc
Sun, 21 Aug 2016 00:00:23 +0300
6cb5af2b
fixed (hopefully) the vol_perc() function
Ali H. Fardan raiz@firemail.cc
Sun, 11 Sep 2016 13:57:04 +0300
6d23d53d
fixed cpu_perc() stupidity && added some useful comment for drkh5h
Ali H. Fardan raiz@firemail.cc
Sun, 11 Sep 2016 13:33:35 +0300
bc38677f
malloc sucks, you know?
Ali H. Fardan raiz@firemail.cc
Wed, 14 Sep 2016 03:35:53 +0300
f28e2682
* != **
Ali H. Fardan raiz@firemail.cc
Wed, 14 Sep 2016 03:35:09 +0300
3e04f1d9
minor improvements and memory leak fix
Ali H. Fardan raiz@firemail.cc
Wed, 14 Sep 2016 03:31:01 +0300
81e8da5d
Merge branch 'master' of https://github.com/drkh5h/slstatus
Ali H. Fardan raiz@firemail.cc
Wed, 14 Sep 2016 03:24:53 +0300
e6158e30
subtraction is unneeded
Ali H. Fardan raiz@firemail.cc
Mon, 12 Sep 2016 13:51:43 +0300
56fffbce
improved hostname()
Ali H. Fardan raiz@firemail.cc
Wed, 14 Sep 2016 12:22:03 +0300
561de544
variable initialization is back
Ali H. Fardan raiz@firemail.cc
Wed, 14 Sep 2016 17:42:48 +0300
35f78627
simplified run_command()
Ali H. Fardan raiz@firemail.cc
Wed, 14 Sep 2016 16:20:20 +0300
f4a38338
several changes
Ali H. Fardan raiz@firemail.cc
Sun, 18 Sep 2016 22:27:04 +0300
4339c833
hostname: use POSIX routine to get hostname rather than reading from procfs
Ali H. Fardan raiz@firemail.cc
Sat, 08 Oct 2016 19:55:25 +0300
fb440d8f
vol_perc: return zero if the value of max is set to zero
user user@1337
Sat, 08 Oct 2016 19:50:53 +0300
39fa1491
get rid of unused variable (silly gcc did not report that error)
Ali H. Fardan raiz@firemail.cc
Wed, 12 Oct 2016 20:54:45 +0300
393b0964
vol_perc: Return "mute" when mixer is muted

This feature was originally removed as part of 52d19f9.
Jody Leonard me@jodyleonard.com
Thu, 13 Oct 2016 03:20:36 -0400
9bef4e88
swap: Print UNKNOWN_STR if no swap is allocated
Jody Leonard me@jodyleonard.com
Sat, 15 Oct 2016 19:50:02 -0400
4d6761e0
Update README.md
Jody Leonard me@jodyleonard.com
Sat, 15 Oct 2016 06:49:33 -0400
46fb6abd
Edit config.def.h function descriptions
Jody Leonard me@jodyleonard.com
Sat, 15 Oct 2016 06:36:21 -0400
c60af317
Add functions for measuring swap
Jody Leonard me@jodyleonard.com
Fri, 14 Oct 2016 05:44:46 -0400
c3eb0c40
Add "uname -r" functionality
Mike Coddington mike@coddington.us
Thu, 03 Nov 2016 11:49:09 -0500
015f832c
Merge branch 'master' into master
Aaron Marcher info@nulltime.net
Thu, 29 Dec 2016 23:27:44 +0100
0a3aa0b4
fix TODO markdown syntax && update
raiz raiz@firemail.cc
Thu, 29 Dec 2016 15:37:17 +0300
b231cd90
add braces to single statements so drkhsh doesn't be upset
raiz raiz@firemail.cc
Thu, 29 Dec 2016 12:40:43 +0300
cfb4a5d3
usage(): return success if -h is called && print more appropriate usage, opts can't be all called at the same time, that's why a separator is required
raiz raiz@firemail.cc
Tue, 27 Dec 2016 20:41:40 +0300
d1dd72ba
another TODO update
raiz raiz@firemail.cc
Tue, 27 Dec 2016 20:33:28 +0300
2994a8d0
TODO update
raiz raiz@firemail.cc
Tue, 27 Dec 2016 20:32:22 +0300
cf67aebe
homepage update
raiz raiz@firemail.cc
Tue, 27 Dec 2016 20:20:45 +0300
ba0f0998
extern/concat.h: don't segfault if count == 0
raiz raiz@firemail.cc
Tue, 27 Dec 2016 20:18:33 +0300
e9f738b8
whhops, my bad
raiz raiz@firemail.cc
Tue, 27 Dec 2016 20:18:09 +0300
94e87eb8
wifi_essid: add boundary check && prevent the use of direct string literal as a format string in snprintf()
raiz raiz@firemail.cc
Tue, 27 Dec 2016 20:14:45 +0300
11fec4fa
don't allow the use of perc if uninitialized
raiz raiz@firemail.cc
Tue, 27 Dec 2016 20:09:07 +0300
8b5b72b6
remove misleading comment
raiz raiz@firemail.cc
Tue, 27 Dec 2016 19:57:16 +0300
13772c39
get rid of set_status() since it's only used once
raiz raiz@firemail.cc
Tue, 27 Dec 2016 19:56:11 +0300
3c8717f4
allow the use of %* symbols in UNKNOWN_STR
raiz raiz@firemail.cc
Tue, 27 Dec 2016 19:53:46 +0300
7db4f5cf
add extra error tests to swap_*() && fix bytes_read bug
raiz raiz@firemail.cc
Tue, 27 Dec 2016 19:49:31 +0300
a36cb96f
swap_*(): add more error tests
raiz raiz@firemail.cc
Tue, 27 Dec 2016 19:26:04 +0300
862d158b
fix delay in a cleaner way
raiz raiz@firemail.cc
Tue, 27 Dec 2016 19:12:39 +0300
6cab2d57
remove newlines from warn() in swap_*(), those functions already print a newline after printing string stderr
raiz raiz@firemail.cc
Tue, 27 Dec 2016 19:07:19 +0300
e1c54762
inititalize run_command()'s buf to UNKNOWN_STR by default
raiz raiz@firemail.cc
Tue, 27 Dec 2016 18:58:31 +0300
b7f45415
remove newline character from run_command() output accurately
raiz raiz@firemail.cc
Tue, 27 Dec 2016 18:57:27 +0300
3bfc3bbc
strtok() has no effect on buf && fgets() should have the full buffer length
raiz raiz@firemail.cc
Tue, 27 Dec 2016 18:54:16 +0300
f62d626d
whhops
raiz raiz@firemail.cc
Sun, 18 Dec 2016 10:36:01 +0300
5a218e99
remove unused strlcpy() and reduce the size of output buffer
raiz raiz@firemail.cc
Sun, 18 Dec 2016 10:35:36 +0300
13604963
Merge branch 'master' into master
parazyd parazyd@users.noreply.github.com
Fri, 30 Dec 2016 14:21:19 +0100
62f40164
add vol_perc notes, add braces to singleline statements
parazyd parazyd@dyne.org
Fri, 30 Dec 2016 12:16:07 +0100
c2808b6d
refactor vol_perc to not depend on alsa libraries
parazyd parazyd@dyne.org
Wed, 28 Dec 2016 00:41:51 +0100
b1e7c40b
Fixed out of boundary write on long lines.

The terminating nul character ('\0') could be written outside the boundary of
the buffer which is used to read characters. If "sizeof(buffer)" characters
are read, the resulting value must not be used as index, because that's an off
by one.

Read sizeof(buffer)-1 bytes instead.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Tobias Stoeckmann tobias@stoeckmann.org
Sun, 02 Apr 2017 13:12:03 +0200
35295f19
On success, fgets always terminates the result.

If fgets succeeds, then the resulting char array is always
terminated by a '\0'. No need to keep extra space, therefore
sizeof(buf) is the correct argument.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Tobias Stoeckmann tobias@stoeckmann.org
Tue, 04 Apr 2017 21:27:31 +0200
9ca1ac62
Print unknown_str in case of error

func can return NULL in case of error, but no checking is done when
printing, and unknown_str wasn't being used anywhere.
SiIky siiky@users.noreply.github.com
Sat, 17 Feb 2018 18:08:27 +0000