[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
smbfs smbnetfs.c
From: |
Ludovic Courtès |
Subject: |
smbfs smbnetfs.c |
Date: |
Sun, 04 Mar 2012 17:22:41 +0000 |
CVSROOT: /sources/hurdextras
Module name: smbfs
Changes by: Ludovic Courtès <civodul> 12/03/04 17:22:41
Modified files:
. : smbnetfs.c
Log message:
Use `asprintf' in the `get_dirents' loop, too.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/smbfs/smbnetfs.c?cvsroot=hurdextras&r1=1.9&r2=1.10
Patches:
Index: smbnetfs.c
===================================================================
RCS file: /sources/hurdextras/smbfs/smbnetfs.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- smbnetfs.c 4 Mar 2012 17:07:47 -0000 1.9
+++ smbnetfs.c 4 Mar 2012 17:22:41 -0000 1.10
@@ -932,12 +932,8 @@
else
continue;
- char stat_file_name[strlen (dir->nn->filename)
- + strlen (dirent->name) + 2];
-
if (!strcmp (dirent->name, "."))
{
- strcpy (stat_file_name, ".");
mutex_lock (&smb_mutex);
err = smbc_stat (dir->nn->filename, &st);
mutex_unlock (&smb_mutex);
@@ -949,7 +945,13 @@
}
else
{
- sprintf (stat_file_name,"%s/%s", dir->nn->filename, dirent->name);
+ char *stat_file_name;
+
+ asprintf (&stat_file_name, "%s/%s",
+ dir->nn->filename, dirent->name);
+ if (stat_file_name == NULL)
+ return ENOMEM;
+
mutex_lock (&smb_mutex);
err = smbc_stat (stat_file_name, &st);
mutex_unlock (&smb_mutex);
- smbfs smbnetfs.c, Ludovic Courtès, 2012/03/04
- smbfs smbnetfs.c, Ludovic Courtès, 2012/03/04
- smbfs smbnetfs.c, Ludovic Courtès, 2012/03/04
- smbfs smbnetfs.c,
Ludovic Courtès <=
- smbfs smbnetfs.c, Ludovic Courtès, 2012/03/04
- smbfs smbnetfs.c, Ludovic Courtès, 2012/03/05
- smbfs smbnetfs.c, Ludovic Courtès, 2012/03/05
- smbfs smbnetfs.c, Ludovic Courtès, 2012/03/14