diff options
author | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-05-18 20:25:50 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-05-18 20:25:50 +0200 |
commit | 9891d13887d66ecee6d6ae960df764d5b8dbc2df (patch) | |
tree | fccc8e2233ad32ce08eaa0cba097365f808fdcfc /sys/src/cmd/webfs/http.c | |
parent | feca85431791736244f7e2c1505ad9976314d9b4 (diff) |
webfs: nstrcpy paranoia
Diffstat (limited to 'sys/src/cmd/webfs/http.c')
-rw-r--r-- | sys/src/cmd/webfs/http.c | 8 |
1 files changed, 4 insertions, 4 deletions
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 */ |