unsigned char * checksum_ptr;
struct directory_entry * de;
struct directory_entry * de2;
- int i;
+ unsigned int i;
int nsectors;
memset(boot_desc, 0, sizeof(*boot_desc));
"Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu
before changing it!
- Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95
+ Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 2009
Free Software Foundation, Inc.
This file is part of the libiberty library. This library is free
software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option)
+Free Software Foundation; either version 3, or (at your option)
any later version.
This library is distributed in the hope that it will be useful,
#endif
#include <stdio.h>
+#include <assert.h>
/* Comment out all this code if we are using the GNU C Library, and are not
actually compiling the library itself. This code is part of the GNU C
for (p = longopts, option_index = 0; p->name; p++, option_index++)
if (!strncmp (p->name, nextchar, nameend - nextchar))
{
- if (nameend - nextchar == strlen (p->name))
+ assert (nameend > nextchar);
+ if (nameend == strlen (p->name) + nextchar)
{
/* Exact match found. */
pfound = p;
#include <stdlib.h>
#include <time.h>
-static int jpath_table_index;
+static unsigned int jpath_table_index;
static struct directory ** jpathlist;
static int next_jpath_index = 1;
static int sort_goof;
int i_ishidden()
{
- return((int)i_mat[0]);
+ return (i_mat[0] != NULL);
}
/* Joliet hide */
int j_ishidden()
{
- return((int)j_mat[0]);
+ return (j_mat[0] != NULL);
}
int omit_period = 0; /* Violates iso9660, but these are a pain */
int transparent_compression = 0; /* So far only works with linux */
int omit_version_number = 0; /* May violate iso9660, but noone uses vers*/
-int RR_relocation_depth = 6; /* Violates iso9660, but most systems work */
+unsigned int RR_relocation_depth = 6; /* Violates iso9660, but most systems work */
int full_iso9660_filenames = 0; /* Used with Amiga. Disc will not work with
DOS */
int allow_leading_dots = 0; /* DOS cannot read names with leading dots */
[-x path -x path ...] path\n");
#endif
- int i;
+ unsigned int i;
/* const char **targets, **pp;*/
fprintf (stderr, "Usage: %s [options] file...\n", program_name);
{
int comma;
int len;
- int j;
+ unsigned int j;
fprintf (stderr, " ");
the ordering of the two. We describe each non-option ARGV-element
as if it were the argument of an option with character code 1. */
{
- int i, is, il;
+ unsigned int i;
+ int is, il;
shortopts[0] = '-';
is = 1;
il = 0;
extern int omit_period;
extern int omit_version_number;
extern int transparent_compression;
-extern int RR_relocation_depth;
+extern unsigned int RR_relocation_depth;
extern int full_iso9660_filenames;
extern int split_SL_component;
extern int split_SL_field;
Copyright 1993 Yggdrasil Computing, Incorporated
+ Copyright (C) 2009 Free Software Foundation, Inc.
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
+ the Free Software Foundation; either version 3, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
static char rcsid[] ="$Id: rock.c,v 1.8 1999/03/02 03:41:26 eric Exp $";
a CE entry for the continuation record */
#define MAYBE_ADD_CE_ENTRY(BYTES) \
- (BYTES + CE_SIZE + currlen + (ipnt - recstart) > reclimit ? 1 : 0)
+ ((unsigned) ((BYTES) + CE_SIZE + currlen + ipnt) > (unsigned) (recstart + reclimit) ? 1 : 0)
/*
* Buffer to build RR attributes
extern int verbose;
-struct stat fstatbuf = {0,}; /* We use this for the artificial entries we create */
+struct stat fstatbuf; /* We use this for the artificial entries we create */
-struct stat root_statbuf = {0, }; /* Stat buffer for root directory */
+struct stat root_statbuf; /* Stat buffer for root directory */
struct directory * reloc_dir = NULL;
}
if (strcmp(short_name,".") && strcmp(short_name,"..") &&
- S_ISDIR(statbuf.st_mode) && this_dir->depth > RR_relocation_depth)
+ S_ISDIR(statbuf.st_mode) && this_dir->depth > RR_relocation_depth)
{
struct directory * child;
#ifdef DEBUG
fprintf(stderr,"%s(%d) ", path, dpnt->depth);
#endif
- if(parent->depth > RR_relocation_depth)
+ if(parent->depth > RR_relocation_depth)
{
fprintf(stderr,"Directories too deep %s\n", path);
exit(1);
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
+#include <assert.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
static struct deferred_write * dw_head = NULL, * dw_tail = NULL;
unsigned int last_extent_written =0;
-static int path_table_index;
+static unsigned int path_table_index;
static time_t begun;
/* We recursively walk through all of the directories and assign extent
char buffer[SECTOR_SIZE * NSECT];
FILE * infile;
int remain;
- int use;
+ unsigned int use;
if ((infile = fopen(filename, "rb")) == NULL)
/*
* Hard links throw us off here
*/
- if(should_write != last_extent - session_start)
+ assert (last_extent > session_start);
+ if(should_write + session_start != last_extent)
{
fprintf(stderr,"Number of extents written not what was predicted. Please fix.\n");
fprintf(stderr,"Predicted = %d, written = %d\n", should_write, last_extent);