Permalink
Browse files

- Use PATH_MAX where appropriate

- Strip directory names in prompt
  • Loading branch information...
megastep committed Jan 25, 2005
1 parent 360ddd9 commit b01161106007acf64a92d18eb62e18d0d4674709
Showing with 15 additions and 15 deletions.
  1. +3 −3 copy.c
  2. +1 −1 file.c
  3. +3 −3 install.c
  4. +1 −1 plugins/cpio.c
  5. +2 −2 plugins/tar.c
  6. +2 −2 plugins/uz2.c
  7. +3 −3 plugins/zip.c
View
6 copy.c
@@ -471,7 +471,7 @@ static ssize_t copy_list(install_info *info, const char *filedesc, const char *d
xmlNodePtr node,
UIUpdateFunc update)
{
char fpat[BUFSIZ];
char fpat[PATH_MAX];
int i;
glob_t globbed;
ssize_t size, copied;
@@ -1093,7 +1093,7 @@ ssize_t copy_tree(install_info *info, xmlNodePtr node, const char *dest,
ssize_t size_manpage(install_info *info, xmlNodePtr node, const char *from_cdrom)
{
struct stat sb;
char fpat[BUFSIZ];
char fpat[PATH_MAX];
char *section = xmlGetProp(node, "section"), *name = xmlGetProp(node, "name");
ssize_t size = 0;
@@ -1123,7 +1123,7 @@ ssize_t size_manpage(install_info *info, xmlNodePtr node, const char *from_cdrom
ssize_t size_binary(install_info *info, const char *from_cdrom, const char *filedesc)
{
struct stat sb;
char fpat[BUFSIZ], final[BUFSIZ];
char fpat[PATH_MAX], final[PATH_MAX];
ssize_t size;
size = 0;
View
2 file.c
@@ -141,7 +141,7 @@ stream *file_open_install(install_info *info, const char *path, const char *mode
if ( prompt_overwrite ) {
char msg[128];
snprintf(msg, sizeof(msg), _("File '%25s' already exists, overwrite?"), path);
snprintf(msg, sizeof(msg), _("File '%25s' already exists, overwrite?"), loki_basename(path));
if ( UI.prompt(msg, RESPONSE_YES) != RESPONSE_YES ) {
return NULL;
}
View
@@ -1,4 +1,4 @@
/* $Id: install.c,v 1.149 2004-12-12 22:39:37 megastep Exp $ */
/* $Id: install.c,v 1.150 2005-01-25 03:00:57 megastep Exp $ */
/* Modifications by Borland/Inprise Corp.:
04/10/2000: Added code to expand ~ in a default path immediately after
@@ -508,7 +508,7 @@ const char *GetProductEULANode(install_info *info, xmlNodePtr node, int *keepdir
eula = xmlGetProp(node, "eula");
if (eula) {
strncpy(matched_name, eula, BUFSIZ);
strncpy(matched_name, eula, sizeof(matched_name));
found = 1;
log_warning("The 'eula' attribute is deprecated, please use the 'eula' element from now on.");
xmlFree(eula);
@@ -559,7 +559,7 @@ const char *GetProductREADME(install_info *info, int *keepdirs)
if ( ! ret ) {
strcpy(matched_name, "README");
} else {
strncpy(matched_name, ret, BUFSIZ);
strncpy(matched_name, ret, sizeof(matched_name));
found = 1;
log_warning("The 'readme' attribute is deprecated, please use the 'readme' element from now on.");
xmlFree(ret);
View
@@ -65,7 +65,7 @@ size_t copy_cpio_stream(install_info *info, stream *input, const char *dest, con
int dir_len = strlen(dest) + 1;
size_t nread, left, copied;
size_t size = 0;
char buf[BUFSIZ];
char buf[PATH_MAX];
int count = 0;
unsigned int user_mode = 0;
/* Optional MD5 sum can be specified in the XML file */
View
@@ -1,5 +1,5 @@
/* TAR plugin for setup */
/* $Id: tar.c,v 1.12 2004-11-02 03:48:57 megastep Exp $ */
/* $Id: tar.c,v 1.13 2005-01-25 03:00:57 megastep Exp $ */
#include "config.h"
#include "plugins.h"
@@ -44,7 +44,7 @@ static size_t TarCopy(install_info *info, const char *path, const char *dest, co
{
static tar_record zeroes;
tar_record record;
char final[BUFSIZ];
char final[PATH_MAX];
stream *input, *output;
size_t size, copied;
size_t this_size;
View
@@ -1,5 +1,5 @@
/* UnrealEngine2-compressed files (.uz2) plugin for setup */
/* $Id: uz2.c,v 1.6 2004-11-02 03:48:57 megastep Exp $ */
/* $Id: uz2.c,v 1.7 2005-01-25 03:00:57 megastep Exp $ */
#include <stdlib.h>
#include <string.h>
@@ -103,7 +103,7 @@ static size_t UZ2Copy(install_info *info, const char *path, const char *dest, co
uint32 csize; /* compressed size */
uint32 usize; /* uncompressed size */
size_t insize = 0;
char final[BUFSIZ];
char final[PATH_MAX];
stream *in;
stream *out;
unsigned int user_mode = 0;
View
@@ -1,5 +1,5 @@
/* ZIP plugin for setup */
/* $Id: zip.c,v 1.9 2004-11-02 03:48:57 megastep Exp $ */
/* $Id: zip.c,v 1.10 2005-01-25 03:00:57 megastep Exp $ */
#include "plugins.h"
#include "file.h"
@@ -665,7 +665,7 @@ static size_t ZIPCopy(install_info *info, const char *path, const char *dest, co
xmlNodePtr node,
UIUpdateFunc update)
{
char final[BUFSIZ];
char final[PATH_MAX];
z_stream zstr;
size_t retval = 0;
ZIPinfo zipinfo;
@@ -850,7 +850,7 @@ static size_t ZIPCopy(install_info *info, const char *path, const char *dest, co
if (symlnk)
{
char lnkname[BUFSIZ];
char lnkname[PATH_MAX];
/* null-terminate string. */
zip_buf_out[entry->uncompressed_size] = '\0';
zip_expand_symlink_path(zip_buf_out);

0 comments on commit b011611

Please sign in to comment.