chiark / gitweb /
util.h: fix typo
[elogind.git] / src / shared / log.c
index 3941e3e1c202d0015b42e9ebff3a93174003efb0..078ccdc35bf709b842c32bb0075fb6dc65cf5dcd 100644 (file)
@@ -871,15 +871,17 @@ void log_parse_environment(void) {
         if (r < 0)
                 log_warning("Failed to read /proc/cmdline. Ignoring: %s", strerror(-r));
         else if (r > 0) {
-                char *w, *state;
+                const char *word, *state;
                 size_t l;
 
-                FOREACH_WORD_QUOTED(w, l, line, state) {
-                        if (l == 5 && startswith(w, "debug")) {
+                FOREACH_WORD_QUOTED(word, l, line, state) {
+                        if (l == 5 && startswith(word, "debug")) {
                                 log_set_max_level(LOG_DEBUG);
                                 break;
                         }
                 }
+                if (!isempty(state))
+                        log_warning("Trailing garbage and the end of kernel commandline, ignoring.");
         }
 
         e = secure_getenv("SYSTEMD_LOG_TARGET");