chiark / gitweb /
resolved: when there's already somebody listening on the LLMNR ports, simple disable...
[elogind.git] / src / timesync / timesyncd.c
index b80e03b349340fcfbdbc0dcfa90ff7f8652a0c97..1bd8cf56145809a4605868b2fd357541965fc8a8 100644 (file)
@@ -984,23 +984,25 @@ static int manager_add_server(Manager *m, const char *server) {
 }
 
 static int manager_add_server_string(Manager *m, const char *string) {
-        char *w, *state;
+        const char *word, *state;
         size_t l;
         int r;
 
         assert(m);
         assert(string);
 
-        FOREACH_WORD_QUOTED(w, l, string, state) {
+        FOREACH_WORD_QUOTED(word, l, string, state) {
                 char t[l+1];
 
-                memcpy(t, w, l);
+                memcpy(t, word, l);
                 t[l] = 0;
 
                 r = manager_add_server(m, t);
                 if (r < 0)
                         log_error("Failed to add server %s to configuration, ignoring: %s", t, strerror(-r));
         }
+        if (!isempty(state))
+                log_warning("Trailing garbage at the end of server list, ignoring.");
 
         return 0;
 }