vergoh / vnstat

vnStat - a network traffic monitor for Linux and BSD
GNU General Public License v2.0
1.45k stars 123 forks source link

Cache environment variable #219

Closed cgzones closed 2 years ago

cgzones commented 2 years ago

Only the gather the requested environment variable once, since it should not change between calls.

Also silences clang-analyzer warnings:

src/cfg.c:561:7: warning: Null pointer passed to 1st parameter expecting 'nonnull' [core.NonNullParamChecker]
                if (strstr(getenv(LC_ALL), UTF) != NULL) {
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vergoh commented 2 years ago

Thanks