]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
typo and cleanups
authorAlan T. DeKok <aland@freeradius.org>
Thu, 26 Jan 2023 20:48:57 +0000 (15:48 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 26 Jan 2023 20:49:24 +0000 (15:49 -0500)
src/lib/server/cf_file.c

index 3ca584f159e46075c5fb1ad3deb3a6d3858789c1..6a17f14526dc8035337f2f8d916407b28b71e6af 100644 (file)
@@ -1194,19 +1194,21 @@ static ssize_t fr_skip_xlat(char const *start, char const *end)
        /*
         *      At least %{1}
         */
-       if (end && ((start + 4) < end)) {
+       if (end && ((start + 4) > end)) {
                fr_strerror_const("Invalid expansion");
                return 0;
        }
 
        if ((*p != '%') && (*p != '$')) {
-       fail:
                fr_strerror_const("Unexpected character in xlat");
                return -(p - start);
        }
 
        p++;
-       if ((*p != '{') && (*p != '(')) goto fail;
+       if ((*p != '{') && (*p != '(')) {
+               fr_strerror_const("Invalid character after '%'");
+               return -(p - start);
+       }
 
        quote = *(p++);
        if (quote == '{') {