]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix some errors
authorRoy Marples <roy@marples.name>
Thu, 2 Oct 2014 10:51:32 +0000 (10:51 +0000)
committerRoy Marples <roy@marples.name>
Thu, 2 Oct 2014 10:51:32 +0000 (10:51 +0000)
dhcp-common.c
dhcp6.c

index 1f2e6c27bb7938147d070257069b884e125f3c7f..72fdceaa59c134a23de618a978a891a9dc35e454 100644 (file)
@@ -465,11 +465,11 @@ print_string(char *dst, size_t len, int type, const uint8_t *data, size_t dl)
                {
                        errno = EINVAL;
                        if (c == '\\') {
-                               if (len  == 0 || len == 1) {
-                                       errno = ENOSPC;
-                                       return -1;
-                               }
                                if (dst) {
+                                       if (len  == 0 || len == 1) {
+                                               errno = ENOSPC;
+                                               return -1;
+                                       }
                                        *dst++ = '\\'; *dst++ = '\\';
                                        len -= 2;
                                }
diff --git a/dhcp6.c b/dhcp6.c
index 3ed743da5a2c72a3d73871c764ab6f014a17907a..44a6386a8d92b8a4a9898afb305b4298ef8722fd 100644 (file)
--- a/dhcp6.c
+++ b/dhcp6.c
@@ -3401,7 +3401,7 @@ delegated:
 
                                do
                                        *v++ = *sap;
-                               while (*sap++ != '\0');
+                               while (*++sap != '\0');
                                *v++ = ' ';
                        }
                }