Mercurial > gftp.yaz
comparison lib/rfc959.c @ 765:d553d14a2565
2006-7-13 Brian Masney <masneyb@gftp.org>
* lib/cache.c lib/config_file.c lib/fsp.c lib/ftps.c lib/gftp.h
lib/local.c lib/misc.c lib/options.h lib/protocols.c lib/rfc2068.c
lib/rfc959.c lib/sshv2.c - started to add some annotations for splint.
Fixed a few minor warnings from splint.
author | masneyb |
---|---|
date | Fri, 14 Jul 2006 00:34:11 +0000 |
parents | d4207e5d2aa3 |
children | 3751478bb260 |
comparison
equal
deleted
inserted
replaced
764:4ed80df6729d | 765:d553d14a2565 |
---|---|
253 { | 253 { |
254 savechar = *endpos; | 254 savechar = *endpos; |
255 *endpos = '\0'; | 255 *endpos = '\0'; |
256 | 256 |
257 len += strlen (startpos) + 2; | 257 len += strlen (startpos) + 2; |
258 newstr = g_realloc (newstr, sizeof (char) * (len + 1)); | 258 newstr = g_realloc (newstr, (gulong) sizeof (char) * (len + 1)); |
259 strcat (newstr, startpos); | 259 strcat (newstr, startpos); |
260 strcat (newstr, "\r\n"); | 260 strcat (newstr, "\r\n"); |
261 | 261 |
262 *endpos = savechar; | 262 *endpos = savechar; |
263 endpos += 2; | 263 endpos += 2; |
273 savechar = *endpos; | 273 savechar = *endpos; |
274 *endpos = '\0'; | 274 *endpos = '\0'; |
275 len += strlen (startpos); | 275 len += strlen (startpos); |
276 if (!newval) | 276 if (!newval) |
277 { | 277 { |
278 newstr = g_realloc (newstr, sizeof (char) * (len + 1)); | 278 newstr = g_realloc (newstr, (gulong) sizeof (char) * (len + 1)); |
279 strcat (newstr, startpos); | 279 strcat (newstr, startpos); |
280 } | 280 } |
281 else | 281 else |
282 { | 282 { |
283 utf8 = gftp_string_from_utf8 (request, newval); | 283 utf8 = gftp_string_from_utf8 (request, newval); |
284 if (utf8 != NULL) | 284 if (utf8 != NULL) |
285 len += strlen (utf8); | 285 len += strlen (utf8); |
286 else | 286 else |
287 len += strlen (newval); | 287 len += strlen (newval); |
288 | 288 |
289 newstr = g_realloc (newstr, sizeof (char) * (len + 1)); | 289 newstr = g_realloc (newstr, (gulong) sizeof (char) * (len + 1)); |
290 strcat (newstr, startpos); | 290 strcat (newstr, startpos); |
291 | 291 |
292 if (utf8 != NULL) | 292 if (utf8 != NULL) |
293 { | 293 { |
294 strcat (newstr, utf8); | 294 strcat (newstr, utf8); |
466 { | 466 { |
467 gftp_lookup_request_option (request, "email", &email); | 467 gftp_lookup_request_option (request, "email", &email); |
468 gftp_set_password (request, email); | 468 gftp_set_password (request, email); |
469 } | 469 } |
470 | 470 |
471 if ((ret = gftp_connect_server (request, "ftp", proxy_hostname, proxy_port)) < 0) | 471 if ((ret = gftp_connect_server (request, "ftp", proxy_hostname, |
472 proxy_port)) < 0) | |
472 return (ret); | 473 return (ret); |
473 | 474 |
474 /* Get the banner */ | 475 /* Get the banner */ |
475 if ((ret = rfc959_read_response (request, 1)) != '2') | 476 if ((ret = rfc959_read_response (request, 1)) != '2') |
476 { | 477 { |
1021 | 1022 |
1022 return (0); | 1023 return (0); |
1023 } | 1024 } |
1024 | 1025 |
1025 | 1026 |
1026 static int | 1027 static unsigned int |
1027 rfc959_is_ascii_transfer (gftp_request * request, const char *filename) | 1028 rfc959_is_ascii_transfer (gftp_request * request, const char *filename) |
1028 { | 1029 { |
1029 gftp_config_list_vars * tmplistvar; | 1030 gftp_config_list_vars * tmplistvar; |
1030 gftp_file_extensions * tempext; | 1031 gftp_file_extensions * tempext; |
1031 intptr_t ascii_transfers; | 1032 intptr_t ascii_transfers; |
1056 | 1057 |
1057 | 1058 |
1058 static int | 1059 static int |
1059 rfc959_set_data_type (gftp_request * request, const char *filename) | 1060 rfc959_set_data_type (gftp_request * request, const char *filename) |
1060 { | 1061 { |
1061 rfc959_parms * parms; | 1062 unsigned int new_ascii; |
1062 int new_ascii, ret; | 1063 rfc959_parms * parms; |
1063 char *tempstr; | 1064 char *tempstr; |
1065 int ret; | |
1064 | 1066 |
1065 g_return_val_if_fail (request != NULL, GFTP_EFATAL); | 1067 g_return_val_if_fail (request != NULL, GFTP_EFATAL); |
1066 | 1068 |
1067 parms = request->protocol_data; | 1069 parms = request->protocol_data; |
1068 new_ascii = rfc959_is_ascii_transfer (request, filename); | 1070 new_ascii = rfc959_is_ascii_transfer (request, filename); |
1225 | 1227 |
1226 return (0); | 1228 return (0); |
1227 } | 1229 } |
1228 | 1230 |
1229 | 1231 |
1230 static long | 1232 static off_t |
1231 rfc959_transfer_file (gftp_request *fromreq, const char *fromfile, | 1233 rfc959_transfer_file (gftp_request *fromreq, const char *fromfile, |
1232 off_t fromsize, gftp_request *toreq, | 1234 off_t fromsize, gftp_request *toreq, |
1233 const char *tofile, off_t tosize) | 1235 const char *tofile, off_t tosize) |
1234 { | 1236 { |
1235 char *tempstr, *pos, *endpos; | 1237 char *tempstr, *pos, *endpos; |