Update ip_string_to_bytes to cert_req version

Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
diff --git a/programs/x509/cert_write.c b/programs/x509/cert_write.c
index 07a59b8..c8412fb 100644
--- a/programs/x509/cert_write.c
+++ b/programs/x509/cert_write.c
@@ -216,17 +216,16 @@
     int format;                 /* format                               */
 } opt;
 
-static int ip_string_to_bytes(const char *str, uint8_t *bytes, int maxBytes)
+static void ip_string_to_bytes(const char *str, uint8_t *bytes, int maxBytes)
 {
     for (int i = 0; i < maxBytes; i++) {
-        bytes[i] = strtoul(str, NULL, 16);
+        bytes[i] = (uint8_t) strtoul(str, NULL, 16);
         str = strchr(str, '.');
         if (str == NULL || *str == '\0') {
             break;
         }
         str++;
     }
-    return 0;
 }
 
 int write_certificate(mbedtls_x509write_cert *crt, const char *output_file,