mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-15 01:52:42 +03:00
vere: replaces "irrelevant" uses of strncpy
This commit is contained in:
parent
6fb743bb4c
commit
4136ab4329
@ -850,12 +850,8 @@ _cttp_creq_connect(u3_creq* ceq_u)
|
||||
|
||||
// set hostname for TLS handshake
|
||||
if ( ceq_u->hot_c && c3y == ceq_u->sec ) {
|
||||
c3_w len_w = 1 + strlen(ceq_u->hot_c);
|
||||
c3_c* hot_c = c3_malloc(len_w);
|
||||
strncpy(hot_c, ceq_u->hot_c, len_w);
|
||||
|
||||
c3_free(ceq_u->cli_u->ssl.server_name);
|
||||
ceq_u->cli_u->ssl.server_name = hot_c;
|
||||
ceq_u->cli_u->ssl.server_name = strdup(ceq_u->hot_c);
|
||||
}
|
||||
|
||||
_cttp_creq_fire(ceq_u);
|
||||
|
@ -108,9 +108,9 @@ _unix_down(c3_c* pax_c, c3_c* sub_c)
|
||||
c3_w sub_w = strlen(sub_c);
|
||||
c3_c* don_c = c3_malloc(pax_w + sub_w + 2);
|
||||
|
||||
strncpy(don_c, pax_c, pax_w);
|
||||
strcpy(don_c, pax_c);
|
||||
don_c[pax_w] = '/';
|
||||
strncpy(don_c + pax_w + 1, sub_c, sub_w);
|
||||
strcpy(don_c + pax_w + 1, sub_c);
|
||||
don_c[pax_w + 1 + sub_w] = '\0';
|
||||
|
||||
return don_c;
|
||||
@ -666,9 +666,9 @@ _unix_create_dir(u3_udir* dir_u, u3_udir* par_u, u3_noun nam)
|
||||
c3_w pax_w = strlen(par_u->pax_c);
|
||||
c3_c* pax_c = c3_malloc(pax_w + 1 + nam_w + 1);
|
||||
|
||||
strncpy(pax_c, par_u->pax_c, pax_w);
|
||||
strcpy(pax_c, par_u->pax_c);
|
||||
pax_c[pax_w] = '/';
|
||||
strncpy(pax_c + pax_w + 1, nam_c, nam_w);
|
||||
strcpy(pax_c + pax_w + 1, nam_c);
|
||||
pax_c[pax_w + 1 + nam_w] = '\0';
|
||||
|
||||
c3_free(nam_c);
|
||||
@ -1111,11 +1111,11 @@ _unix_sync_file(u3_unix* unx_u, u3_udir* par_u, u3_noun nam, u3_noun ext, u3_nou
|
||||
c3_w ext_w = strlen(ext_c);
|
||||
c3_c* pax_c = c3_malloc(par_w + 1 + nam_w + 1 + ext_w + 1);
|
||||
|
||||
strncpy(pax_c, par_u->pax_c, par_w);
|
||||
strcpy(pax_c, par_u->pax_c);
|
||||
pax_c[par_w] = '/';
|
||||
strncpy(pax_c + par_w + 1, nam_c, nam_w);
|
||||
strcpy(pax_c + par_w + 1, nam_c);
|
||||
pax_c[par_w + 1 + nam_w] = '.';
|
||||
strncpy(pax_c + par_w + 1 + nam_w + 1, ext_c, ext_w);
|
||||
strcpy(pax_c + par_w + 1 + nam_w + 1, ext_c);
|
||||
pax_c[par_w + 1 + nam_w + 1 + ext_w] = '\0';
|
||||
|
||||
c3_free(nam_c); c3_free(ext_c);
|
||||
|
@ -115,7 +115,8 @@ _walk_mkdirp(c3_c* bas_c, u3_noun pax)
|
||||
len_w = 1 + fas_w + pax_w;
|
||||
|
||||
pax_c = c3_malloc(1 + len_w);
|
||||
strncpy(pax_c, bas_c, len_w);
|
||||
strcpy(pax_c, bas_c);
|
||||
|
||||
pax_c[fas_w] = '/';
|
||||
waq_y = (void*)(1 + pax_c + fas_w);
|
||||
u3r_bytes(0, pax_w, waq_y, u3h(pax));
|
||||
|
Loading…
Reference in New Issue
Block a user