H
helmuterik
I got this one to work:
#include <stdlib.h>
#include <stdio.h>
int main(void) {
char bytearray[10] = "f ";
char string[100];
snprintf(string, sizeof(string)-1, "%.*s/%.*s",
( (char *) memchr(bytearray, ' ', 10) == NULL ? 10 : (( (char *)
memchr(bytearray, ' ', 10)) - bytearray)),
bytearray,
( (char *) memchr(bytearray, ' ', 10) == NULL ? 10 : (( (char *)
memchr(bytearray, ' ', 10)) - bytearray)),
bytearray);
printf("%s\n", string);
return 0;
}
Not that I will use it in production though.
#include <stdlib.h>
#include <stdio.h>
int main(void) {
char bytearray[10] = "f ";
char string[100];
snprintf(string, sizeof(string)-1, "%.*s/%.*s",
( (char *) memchr(bytearray, ' ', 10) == NULL ? 10 : (( (char *)
memchr(bytearray, ' ', 10)) - bytearray)),
bytearray,
( (char *) memchr(bytearray, ' ', 10) == NULL ? 10 : (( (char *)
memchr(bytearray, ' ', 10)) - bytearray)),
bytearray);
printf("%s\n", string);
return 0;
}
Not that I will use it in production though.