diff options
author | Jeremy Allison <jra@samba.org> | 2007-11-20 15:31:37 -0800 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2007-11-20 15:31:37 -0800 |
commit | c049b8157d0bb4b5cd57b66740a26813be4f9eba (patch) | |
tree | 6f686883427361d8e8420a3725f33b8e9f4fb74d /source3/rpc_parse | |
parent | 61b37c73eeff8548c63df76e7d650c27746ca720 (diff) | |
download | samba-c049b8157d0bb4b5cd57b66740a26813be4f9eba.tar.gz samba-c049b8157d0bb4b5cd57b66740a26813be4f9eba.tar.bz2 samba-c049b8157d0bb4b5cd57b66740a26813be4f9eba.zip |
More trivial pstring removal.
Jeremy.
(This used to be commit bac3bb2f6e9e15b3a9a6a6511c484f8509918ca1)
Diffstat (limited to 'source3/rpc_parse')
-rw-r--r-- | source3/rpc_parse/parse_net.c | 2 | ||||
-rw-r--r-- | source3/rpc_parse/parse_prs.c | 11 |
2 files changed, 9 insertions, 4 deletions
diff --git a/source3/rpc_parse/parse_net.c b/source3/rpc_parse/parse_net.c index e12d9dda0d..df11c6d75a 100644 --- a/source3/rpc_parse/parse_net.c +++ b/source3/rpc_parse/parse_net.c @@ -1086,7 +1086,7 @@ bool net_io_r_srv_pwset(const char *desc, NET_R_SRV_PWSET *r_s, prs_struct *ps, static int init_dom_sid2s(TALLOC_CTX *ctx, const char *sids_str, DOM_SID2 **ppsids) { const char *ptr; - pstring s2; + fstring s2; int count = 0; DEBUG(4,("init_dom_sid2s: %s\n", sids_str ? sids_str:"")); diff --git a/source3/rpc_parse/parse_prs.c b/source3/rpc_parse/parse_prs.c index a30e96772a..137e0dabac 100644 --- a/source3/rpc_parse/parse_prs.c +++ b/source3/rpc_parse/parse_prs.c @@ -48,14 +48,18 @@ void prs_dump_region(char *name, int v, prs_struct *ps, int from_off, int to_off) { int fd, i; - pstring fname; + char *fname = NULL; ssize_t sz; if (DEBUGLEVEL < 50) return; for (i=1;i<100;i++) { if (v != -1) { - slprintf(fname,sizeof(fname)-1, "/tmp/%s_%d.%d.prs", name, v, i); + if (asprintf(&fname,"/tmp/%s_%d.%d.prs", name, v, i) < 0) { + return; + } } else { - slprintf(fname,sizeof(fname)-1, "/tmp/%s.%d.prs", name, i); + if (asprintf(&fname,"/tmp/%s.%d.prs", name, i) < 0) { + return; + } } fd = open(fname, O_WRONLY|O_CREAT|O_EXCL, 0644); if (fd != -1 || errno != EEXIST) break; @@ -69,6 +73,7 @@ void prs_dump_region(char *name, int v, prs_struct *ps, DEBUG(0,("created %s\n", fname)); } } + SAFE_FREE(fname); } /******************************************************************* |