]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/basic/strbuf.c
tree-wide: beautify remaining copyright statements
[thirdparty/systemd.git] / src / basic / strbuf.c
index 5a416ce2866d22233116b3bf409ed131ce169a8f..56e814c07af750140c896028d45430ba869d970d 100644 (file)
@@ -1,21 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
 /***
-  This file is part of systemd.
-
-  Copyright 2012 Kay Sievers <kay@vrfy.org>
-
-  systemd is free software; you can redistribute it and/or modify it
-  under the terms of the GNU Lesser General Public License as published by
-  the Free Software Foundation; either version 2.1 of the License, or
-  (at your option) any later version.
-
-  systemd is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public License
-  along with systemd; If not, see <http://www.gnu.org/licenses/>.
+  Copyright © 2012 Kay Sievers <kay@vrfy.org>
 ***/
 
 #include <errno.h>
@@ -133,9 +118,12 @@ ssize_t strbuf_add_string(struct strbuf *str, const char *s, size_t len) {
                 return -EINVAL;
 
         /* search string; start from last character to find possibly matching tails */
-        if (len == 0)
-                return 0;
+
         str->in_count++;
+        if (len == 0) {
+                str->dedup_count++;
+                return 0;
+        }
         str->in_len += len;
 
         node = str->root;