aboutsummaryrefslogtreecommitdiff
path: root/libssh/base64.c
diff options
context:
space:
mode:
Diffstat (limited to 'libssh/base64.c')
-rw-r--r--libssh/base64.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/libssh/base64.c b/libssh/base64.c
index 15636d73..42ee52bf 100644
--- a/libssh/base64.c
+++ b/libssh/base64.c
@@ -213,17 +213,18 @@ static int _base64_to_bin(unsigned char dest[3], const char *source, int num) {
return 0;
}
-/* counts the number of "=" signs, and replace them by zeroes */
-static int get_equals(char *string){
- char *ptr=string;
- int num=0;
- while((ptr=strchr(ptr,'='))){
- num++;
- *ptr=0;
- ptr++;
- }
+/* Count the number of "=" signs and replace them by zeroes */
+static int get_equals(char *string) {
+ char *ptr = string;
+ int num = 0;
+
+ while ((ptr=strchr(ptr,'=')) != NULL) {
+ num++;
+ *ptr = '\0';
+ ptr++;
+ }
- return num;
+ return num;
}
/* thanks sysk for debugging my mess :) */