]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/shared/specifier.c
Add SPDX license identifiers to source files under the LGPL
[thirdparty/systemd.git] / src / shared / specifier.c
index 841f4654b08c1840d0ddce54cfe1afb87817fb75..b0f00dbb5a558ff407c663b87c314a4d768b6c65 100644 (file)
@@ -1,5 +1,4 @@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
@@ -109,6 +108,10 @@ int specifier_printf(const char *text, const Specifier table[], void *userdata,
                         *(t++) = *f;
         }
 
+        /* if string ended with a stray %, also end with % */
+        if (percent)
+                *(t++) = '%';
+
         *t = 0;
         *_ret = ret;
         return 0;