changeset 531:65cd664cbf32

2004-8-17 Brian Masney <masneyb@gftp.org> * lib/rfc959.c lib/sshv2.c - removed unneeded code in the *_chmod() functions
author masneyb
date Wed, 18 Aug 2004 00:56:58 +0000
parents c39eb5731b32
children bccfdbfaac00
files ChangeLog lib/rfc959.c lib/sshv2.c
diffstat 3 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Aug 13 19:46:21 2004 +0000
+++ b/ChangeLog	Wed Aug 18 00:56:58 2004 +0000
@@ -1,3 +1,7 @@
+2004-8-17 Brian Masney <masneyb@gftp.org>
+	* lib/rfc959.c lib/sshv2.c - removed unneeded code in the *_chmod()
+	functions
+
 2004-8-9 Brian Masney <masneyb@gftp.org>
 	* lib/sshv2.c - fixes so that file permissions are preserved properly
 	on file upload. Fixes so that the Utime and Chmod commands are shown
@@ -2726,7 +2730,7 @@
 
 	* cvsclean - added this script
 
-	* *.[ch] - added $Id: ChangeLog,v 1.304 2004/08/10 02:55:35 masneyb Exp $ tags
+	* *.[ch] - added $Id: ChangeLog,v 1.305 2004/08/18 00:56:58 masneyb Exp $ tags
 
 	* debian/* - updated files from Debian maintainer
 
--- a/lib/rfc959.c	Fri Aug 13 19:46:21 2004 +0000
+++ b/lib/rfc959.c	Wed Aug 18 00:56:58 2004 +0000
@@ -1663,16 +1663,13 @@
 rfc959_chmod (gftp_request * request, const char *file, mode_t mode)
 {
   char *tempstr;
-  size_t len;
   int ret;
 
   g_return_val_if_fail (request != NULL, GFTP_EFATAL);
   g_return_val_if_fail (file != NULL, GFTP_EFATAL);
   g_return_val_if_fail (request->datafd > 0, GFTP_EFATAL);
 
-  len = strlen (file) + (mode / 10) + 20;
-  tempstr = g_malloc (len);
-  snprintf (tempstr, len, "SITE CHMOD %o %s\r\n", mode, file);
+  tempstr = g_strdup_printf ("SITE CHMOD %o %s\r\n", mode, file);
   ret = rfc959_send_command (request, tempstr, 1);
   g_free (tempstr);
 
--- a/lib/sshv2.c	Fri Aug 13 19:46:21 2004 +0000
+++ b/lib/sshv2.c	Wed Aug 18 00:56:58 2004 +0000
@@ -1481,7 +1481,7 @@
 static int 
 sshv2_chmod (gftp_request * request, const char *file, mode_t mode)
 {
-  char *tempstr, *endpos, buf[10];
+  char *tempstr, *endpos;
   sshv2_message message;
   guint32 num;
   size_t len;
@@ -1497,8 +1497,7 @@
   num = htonl (SSH_FILEXFER_ATTR_PERMISSIONS);
   memcpy (endpos, &num, 4);
 
-  g_snprintf (buf, sizeof (buf), "%o", mode);
-  num = htonl (strtol (buf, NULL, 8));
+  num = htonl (mode);
   memcpy (endpos + 4, &num, 4);
 
   ret = sshv2_send_command (request, SSH_FXP_SETSTAT, tempstr, len);