From ba476eda5a734498ba74fb13e3b4bd1e56c84447 Mon Sep 17 00:00:00 2001 From: Andrea Luzzardi Date: Sun, 18 Mar 2007 21:58:04 +0000 Subject: [PATCH] Reindented --- pam_usb/src/xpath.c | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/pam_usb/src/xpath.c b/pam_usb/src/xpath.c index b4963da..f9d5645 100644 --- a/pam_usb/src/xpath.c +++ b/pam_usb/src/xpath.c @@ -47,31 +47,32 @@ static xmlXPathObject *pusb_xpath_match(xmlDocPtr doc, const char *path) return (result); } -static int pusb_xpath_strip_string(char *dest, const char *src, size_t size) +static int pusb_xpath_strip_string(char *dest, const char *src, + size_t size) { - int first_char = -1; - int last_char = -1; - int i; + int first_char = -1; + int last_char = -1; + int i; - for (i = 0; src[i]; ++i) - { - if (isspace(src[i])) - continue ; + for (i = 0; src[i]; ++i) + { + if (isspace(src[i])) + continue ; - if (first_char == -1) - first_char = i; - last_char = i; - } + if (first_char == -1) + first_char = i; + last_char = i; + } - if (first_char == -1 || last_char == -1) - return (0); + if (first_char == -1 || last_char == -1) + return (0); - if ((last_char - first_char) > (size - 1)) - return (0); + if ((last_char - first_char) > (size - 1)) + return (0); - memset(dest, 0x0, size); - strncpy(dest, &(src[first_char]), last_char - first_char + 1); - return (1); + memset(dest, 0x0, size); + strncpy(dest, &(src[first_char]), last_char - first_char + 1); + return (1); } int pusb_xpath_get_string(xmlDocPtr doc, const char *path, @@ -104,7 +105,7 @@ int pusb_xpath_get_string(xmlDocPtr doc, const char *path, xmlFree(result_string); xmlXPathFreeObject(result); log_debug("Result for %s (%s) is too long (max: %d)\n", - path, (const char *)result_string, size); + path, (const char *)result_string, size); return (0); } xmlFree(result_string);