On 07/04/2016 02:47 PM, Vito Mulè wrote: > stopped using strcpy, Why?
> + size_t query_len = strlen(argv_host); > + char *str_token = malloc(query_len+1 * sizeof(char)); > + strncpy(str_token, argv_host, query_len+1); Ignoring the way you've taken 3 lines to say strdup() (and your sizeof(char) is only applying to the 1, not query_len+1, but it's ok because sizeof(char) is a constant 1 on every system linux has ever supported)... My question is that you're effectively doing: strncpy(str_token, argv_host, strlen(argv_host)+1); So how is this better than strcpy()? > + strncpy(host, domain, strlen(domain)); Here you're literally doing that. Why? Rob _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
