From 9891d13887d66ecee6d6ae960df764d5b8dbc2df Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Fri, 18 May 2012 20:25:50 +0200 Subject: webfs: nstrcpy paranoia --- sys/src/cmd/webfs/http.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sys/src/cmd/webfs/http.c') diff --git a/sys/src/cmd/webfs/http.c b/sys/src/cmd/webfs/http.c index 423aab124..9b951e4fe 100644 --- a/sys/src/cmd/webfs/http.c +++ b/sys/src/cmd/webfs/http.c @@ -108,7 +108,7 @@ hdial(Url *u) h->keep = 1; h->len = 0; h->fd = fd; - strncpy(h->addr, addr, sizeof(h->addr)); + nstrcpy(h->addr, addr, sizeof(h->addr)); return h; } @@ -441,7 +441,7 @@ http(char *m, Url *u, Key *shdr, Buq *qbody, Buq *qpost) incref(qbody); if(qpost) incref(qpost); - strncpy(method, m, sizeof(method)); + nstrcpy(method, m, sizeof(method)); switch(rfork(RFPROC|RFMEM|RFNOWAIT)){ default: return; @@ -640,7 +640,7 @@ http(char *m, Url *u, Key *shdr, Buq *qbody, Buq *qpost) if(cistrcmp(s, "ICY")) break; } - strncpy(status, x, sizeof(status)); + nstrcpy(status, x, sizeof(status)); continue; } if((k = parsehdr(s)) == nil) @@ -730,7 +730,7 @@ http(char *m, Url *u, Key *shdr, Buq *qbody, Buq *qpost) qpost = nil; } if(cistrcmp(method, "HEAD")) - strncpy(method, "GET", sizeof(method)); + nstrcpy(method, "GET", sizeof(method)); case 301: /* Moved Permanently */ case 307: /* Temporary Redirect */ case 308: /* Resume Incomplete */ -- cgit v1.2.3