From 73b0a2bdf8b667a5ad70bb4bcc08409e8c9ef7aa Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 11 Jan 2003 12:04:14 +0000 Subject: Fix a number of client-side fstring/pstring mixups. Andrew Bartlett (This used to be commit fe1cc779d5ea77e87dbc0e2edf7c34a354fee6e0) --- source3/libsmb/clilist.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source3/libsmb/clilist.c') diff --git a/source3/libsmb/clilist.c b/source3/libsmb/clilist.c index 4a1737af49..89ab5d6414 100644 --- a/source3/libsmb/clilist.c +++ b/source3/libsmb/clilist.c @@ -324,9 +324,11 @@ static int interpret_short_filename(struct cli_state *cli, char *p,file_info *fi finfo->mtime = finfo->atime = finfo->ctime; finfo->size = IVAL(p,26); clistr_pull(cli, finfo->name, p+30, sizeof(finfo->name), 12, STR_ASCII); - if (strcmp(finfo->name, "..") && strcmp(finfo->name, ".")) - fstrcpy(finfo->short_name,finfo->name); - + if (strcmp(finfo->name, "..") && strcmp(finfo->name, ".")) { + strncpy(finfo->short_name,finfo->name, sizeof(finfo->short_name)-1); + finfo->short_name[sizeof(finfo->short_name)-1] = '\0'; + } + return(DIR_STRUCT_SIZE); } -- cgit