chiark / gitweb /
coverity: fix a couple of bugs found by coverity
[elogind.git] / src / timedated.c
index 66e50a68687e884f9e3fb1809430f009e78dbcf7..f6fe2d83b646429c5ca04c45d137664a00d9eea9 100644 (file)
@@ -246,7 +246,7 @@ static int write_data_local_rtc(void) {
 
                 p++;
                 e = strchr(p, '\n');
-                if (!p) {
+                if (!e) {
                         free(s);
                         return -EIO;
                 }