/*
- * $Id: asingle.c,v 1.8.6.1 2003-09-03 20:40:50 didg Exp $
+ * $Id: asingle.c,v 1.8.6.1.4.1 2005-02-06 10:16:00 didg Exp $
*/
#ifdef HAVE_CONFIG_H
break;
}
- if ( single.entry[ entry_id ].ade_len < 0 ) {
- fprintf( stderr, "single_read: Trying to read past end of fork!\n" );
- return( single.entry[ entry_id ].ade_len );
+ if (single.entry[entry_id].ade_len > length) {
+ fprintf(stderr, "single_read: Trying to read past end of fork!, length %d, ade_len == %u\n", length, single.entry[entry_id].ade_len);
+ return single.entry[entry_id].ade_len;
}
if ( single.entry[ entry_id ].ade_len == 0 ) {
if ( fork == DATA ) {
/*
- * $Id: hqx.c,v 1.12.4.1 2003-09-03 20:40:50 didg Exp $
+ * $Id: hqx.c,v 1.12.4.1.4.1 2005-02-06 10:16:00 didg Exp $
*/
#ifdef HAVE_CONFIG_H
fprintf( stderr, "hqx_read: remaining length is %d\n", hqx.forklen[fork] );
#endif /* DEBUG >= 3 */
- if ( hqx.forklen[ fork ] < 0 ) {
- fprintf( stderr, "This should never happen, dude!\n" );
- return( hqx.forklen[ fork ] );
+ if (hqx.forklen[fork] > length) {
+ fprintf(stderr, "This should never happen, dude! length %d, fork length == %u\n", length, hqx.forklen[fork]);
+ return hqx.forklen[fork];
}
if ( hqx.forklen[ fork ] == 0 ) {
/*
- * $Id: macbin.c,v 1.10.10.1 2004-08-10 13:37:18 bfernhomberg Exp $
+ * $Id: macbin.c,v 1.10.10.1.2.1 2005-02-06 10:16:00 didg Exp $
*/
#ifdef HAVE_CONFIG_H
fprintf( stderr, "bin_read: remaining length is %d\n", bin.forklen[fork] );
#endif /* DEBUG >= 3 */
- if ( bin.forklen[ fork ] < 0 ) {
- fprintf( stderr, "This should never happen, dude!\n" );
- return( bin.forklen[ fork ] );
+ if (bin.forklen[fork] > length) {
+ fprintf(stderr, "This should never happen, dude! length %d, fork length == %u\n", length, bin.forklen[fork]);
+ return bin.forklen[fork];
}
if ( bin.forklen[ fork ] == 0 ) {
perror( "Couldn't write to macbinary file:" );
return( cc );
}
- bin.forklen[ fork ] -= length;
- if ( bin.forklen[ fork ] < 0 ) {
- fprintf( stderr, "This should never happen, dude!\n" );
- return( bin.forklen[ fork ] );
+ if (length > bin.forklen[fork]) {
+ fprintf(stderr, "This should never happen, dude! length %d, fork length %u\n", length, bin.forklen[fork]);
+ return bin.forklen[fork];
}
+ bin.forklen[fork] -= length;
+
/*
* add the padding at end of data and resource forks
*/
0,
iso8859_adapted_pull,
iso8859_adapted_push,
- CHARSET_MULTIBYTE | CHARSET_PRECOMPOSED
+ CHARSET_MULTIBYTE | CHARSET_PRECOMPOSED,
+ NULL, NULL
};
/*
- * $Id: appl.c,v 1.12.2.1.2.2 2004-02-20 21:22:57 didg Exp $
+ * $Id: appl.c,v 1.12.2.1.2.2.2.1 2005-02-06 10:16:00 didg Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
#include "file.h"
#include "desktop.h"
-static struct savedt sa = { { 0, 0, 0, 0 }, -1, 0 };
+static struct savedt sa = { { 0, 0, 0, 0 }, -1, 0, 0};
static __inline__ int pathcmp( p, plen, q, qlen )
char *p;
static int applopen( vol, creator, flags, mode )
struct vol *vol;
u_char creator[ 4 ];
+int flags;
+int mode;
{
char *dtf, *adt, *adts;
attrs = finfo->attrs;
}
else if (*path->u_name == '.') {
+ /* FIXME 0x4000 becomes 0x00 on bigendian */
attrs = htons(FINDERINFO_INVISIBLE);
}
/*
- * $Id: desktop.c,v 1.26.2.4.2.18 2004-10-09 12:48:21 didg Exp $
+ * $Id: desktop.c,v 1.26.2.4.2.18.2.1 2005-02-06 10:16:01 didg Exp $
*
* See COPYRIGHT.
*
return( AFP_OK );
}
-struct savedt si = { { 0, 0, 0, 0 }, -1, 0 };
+struct savedt si = { { 0, 0, 0, 0 }, -1, 0, 0 };
static char *icon_dtfile(struct vol *vol, u_char creator[ 4 ])
{
static int iconopen( vol, creator, flags, mode )
struct vol *vol;
u_char creator[ 4 ];
+int flags;
+int mode;
{
char *dtf, *adt, *adts;
/*
- * $Id: volume.c,v 1.51.2.7.2.33.2.2 2004-12-10 13:33:34 didg Exp $
+ * $Id: volume.c,v 1.51.2.7.2.33.2.3 2005-02-06 10:16:01 didg Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
}
/* ------------------------- */
-int static stat_vol(u_int16_t bitmap, struct vol *vol, char *rbuf, int *rbuflen)
+static int stat_vol(u_int16_t bitmap, struct vol *vol, char *rbuf, int *rbuflen)
{
struct stat st;
int buflen, ret;
/*
- * $Id: config.c,v 1.13.6.5.2.2 2005-01-31 19:50:40 didg Exp $
+ * $Id: config.c,v 1.13.6.5.2.3 2005-02-06 10:16:02 didg Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
struct interface *iface, *niface;
char line[ MAXLINELEN ], **argv, *p;
unsigned int i, j;
- int s, cc;
+ int s, cc = 0;
FILE *conf;
if ( cf == NULL ) {
/*
- * $Id: auth.c,v 1.6.8.2 2004-02-14 00:30:51 didg Exp $
+ * $Id: auth.c,v 1.6.8.2.2.1 2005-02-06 10:16:02 didg Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
#include "uam_auth.h"
static struct uam_mod uam_modules = {NULL, NULL, &uam_modules, &uam_modules};
-static struct uam_obj uam_login = {"", "", 0, {{NULL}}, &uam_login,
+static struct uam_obj uam_login = {"", "", 0, {{NULL, NULL}}, &uam_login,
&uam_login};
-static struct uam_obj uam_changepw = {"", "", 0, {{NULL}}, &uam_changepw,
+static struct uam_obj uam_changepw = {"", "", 0, {{NULL, NULL}}, &uam_changepw,
&uam_changepw};
-static struct uam_obj uam_printer = {"", "", 0, {{NULL}}, &uam_printer,
+static struct uam_obj uam_printer = {"", "", 0, {{NULL, NULL}}, &uam_printer,
&uam_printer};
/*
- * $Id: headers.c,v 1.9.10.1 2004-06-09 01:25:53 bfernhomberg Exp $
+ * $Id: headers.c,v 1.9.10.1.2.1 2005-02-06 10:16:02 didg Exp $
*
* Copyright (c) 1990,1994 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
* "Header" comments.
*/
struct papd_comment headers[] = {
- { "%%Title:", 0, ch_title, 0 },
- { "%%For:", 0, ch_for, 0 },
- { "%%Creator:", 0, ch_creator, 0 },
- { "%%EndComments", 0, ch_endcomm, 0 },
- { "%%BeginFeature", 0, ch_starttranslate, 0 },
- { "%%EndFeature", 0, ch_endtranslate, 0 },
- { "%%BeginPageSetup", 0, ch_starttranslate, 0 },
- { "%%EndPageSetup", 0, ch_endtranslate, 0 },
+ { "%%Title:", NULL, ch_title, 0 },
+ { "%%For:", NULL, ch_for, 0 },
+ { "%%Creator:", NULL, ch_creator, 0 },
+ { "%%EndComments", NULL, ch_endcomm, 0 },
+ { "%%BeginFeature", NULL, ch_starttranslate, 0 },
+ { "%%EndFeature", NULL, ch_endtranslate, 0 },
+ { "%%BeginPageSetup", NULL, ch_starttranslate, 0 },
+ { "%%EndPageSetup", NULL, ch_endtranslate, 0 },
#if 0
- { "%%BeginSetup", 0, ch_translateone, 0 },
- { "%%EndSetup", 0, ch_translateone, 0 },
- { "%%BeginProlog", 0, ch_translateone, 0 },
- { "%%EndProlog", 0, ch_translateone, 0 },
- { "%%Page:", 0, ch_translateone, 0 },
- { "%%PageTrailer", 0, ch_translateone, 0 },
- { "%%Trailer", 0, ch_translateone, 0 },
- { "%%EOF", 0, ch_translateone, 0 },
+ { "%%BeginSetup", NULL, ch_translateone, 0 },
+ { "%%EndSetup", NULL, ch_translateone, 0 },
+ { "%%BeginProlog", NULL, ch_translateone, 0 },
+ { "%%EndProlog", NULL, ch_translateone, 0 },
+ { "%%Page:", NULL, ch_translateone, 0 },
+ { "%%PageTrailer", NULL, ch_translateone, 0 },
+ { "%%Trailer", NULL, ch_translateone, 0 },
+ { "%%EOF", NULL, ch_translateone, 0 },
#endif
- { "%%", 0, ch_translateone, 0 },
- { 0 },
+ { "%%", NULL, ch_translateone, 0 },
+ { NULL, NULL, NULL, 0 },
};
/*
- * $Id: magics.c,v 1.11.6.2 2004-08-23 22:31:58 bfernhomberg Exp $
+ * $Id: magics.c,v 1.11.6.2.2.1 2005-02-06 10:16:02 didg Exp $
*
* Copyright (c) 1990,1994 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
struct papd_comment magics[] = {
- { "%!PS-Adobe-3.0 Query", 0, cm_psquery, C_FULL },
- { "%!PS-Adobe-3.0", 0, cm_psadobe, C_FULL },
- { "%!PS-Adobe-", 0, cm_psswitch, 0 },
- { 0 },
+ { "%!PS-Adobe-3.0 Query", NULL, cm_psquery, C_FULL },
+ { "%!PS-Adobe-3.0", NULL, cm_psadobe, C_FULL },
+ { "%!PS-Adobe-", NULL, cm_psswitch, 0 },
+ { NULL, NULL, NULL, 0 },
};
/*
- * $Id: ppd.c,v 1.9.8.1.2.1 2005-01-31 17:01:07 didg Exp $
+ * $Id: ppd.c,v 1.9.8.1.2.2 2005-02-06 10:16:02 didg Exp $
*
* Copyright (c) 1995 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
size_t bufsize;
FILE *stream;
{
- char p; /* uninitialized, OK 310105 */
+ int p; /* uninitialized, OK 310105 */
size_t count = 0;
while (count < bufsize && EOF != (p=fgetc(stream))) {
/*
- * $Id: queries.c,v 1.16.2.1.2.1 2004-06-09 01:25:54 bfernhomberg Exp $
+ * $Id: queries.c,v 1.16.2.1.2.1.2.1 2005-02-06 10:16:02 didg Exp $
*
* Copyright (c) 1990,1994 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
{ "ADOIsBinaryOK?", gq_true },
{ "UMICHListQueue", gq_true },
{ "UMICHDeleteJob", gq_true },
- { NULL },
+ { NULL, NULL },
};
int cq_query( in, out )
*/
struct papd_comment queries[] = {
#ifdef KRB
- { "%%Login: UMICHKerberosIV", 0, cq_k4login, 0 },
- { "%%?BeginUAMethodsQuery", "%%?EndUAMethodsQuery:", cq_uameth, C_FULL },
+ { "%%Login: UMICHKerberosIV", NULL, cq_k4login, 0 },
+ { "%%?BeginUAMethodsQuery", "%%?EndUAMethodsQuery:", cq_uameth,C_FULL },
#endif /* KRB */
#ifndef HAVE_CUPS
- { "%UMICHListQueue", 0, cq_listq, C_FULL },
- { "%UMICHDeleteJob", 0, cq_rmjob, 0 },
+ { "%UMICHListQueue", NULL, cq_listq, C_FULL },
+ { "%UMICHDeleteJob", NULL, cq_rmjob, 0 },
#endif /* HAVE_CUPS */
{ "%%?BeginQuery: RBILogin ", "%%?EndQuery", cq_rbilogin, 0 },
{ "%%?BeginQuery", "%%?EndQuery", cq_query, 0 },
{ "%%?BeginFeatureQuery", "%%?EndFeatureQuery", cq_feature, 0 },
{ "%%?BeginFontQuery", "%%?EndFontQuery", cq_font, 0 },
- { "%%?BeginPrinterQuery", "%%?EndPrinterQuery", cq_printer, C_FULL },
+ { "%%?BeginPrinterQuery", "%%?EndPrinterQuery", cq_printer,C_FULL },
{ "%%?Begin", "%%?End", cq_default, 0 },
- { 0 },
+ { NULL, NULL, NULL, 0 },
};
/*
- * $Id: cnid_dbd.c,v 1.1.4.18.2.1 2005-01-30 20:56:22 didg Exp $
+ * $Id: cnid_dbd.c,v 1.1.4.18.2.2 2005-02-06 10:16:03 didg Exp $
*
* Copyright (C) Joerg Lenneis 2003
* All Rights Reserved. See COPYING.
"dbd",
{NULL, NULL},
cnid_dbd_open,
+ 0
};
#endif /* CNID_DBD */
/*
- * $Id: cnid_last.c,v 1.1.4.1.2.1 2005-01-30 20:56:23 didg Exp $
+ * $Id: cnid_last.c,v 1.1.4.1.2.2 2005-02-06 10:16:03 didg Exp $
*
* Copyright (c) 1999. Adrian Sun (asun@zoology.washington.edu)
* All Rights Reserved. See COPYRIGHT.
"last",
{NULL, NULL},
cnid_last_open,
+ 0
};
/* Return the did/name pair corresponding to a CNID. */
29,
mac_centraleurope_pull,
mac_centraleurope_push,
- CHARSET_CLIENT | CHARSET_MULTIBYTE
+ CHARSET_CLIENT | CHARSET_MULTIBYTE,
+ NULL, NULL
};
7,
mac_cyrillic_pull,
mac_cyrillic_push,
- CHARSET_CLIENT | CHARSET_MULTIBYTE
+ CHARSET_CLIENT | CHARSET_MULTIBYTE,
+ NULL, NULL
};
5,
mac_hebrew_pull,
mac_hebrew_push,
- CHARSET_CLIENT | CHARSET_MULTIBYTE
+ CHARSET_CLIENT | CHARSET_MULTIBYTE,
+ NULL, NULL
};
0,
mac_roman_pull,
mac_roman_push,
- CHARSET_CLIENT | CHARSET_MULTIBYTE | CHARSET_PRECOMPOSED
+ CHARSET_CLIENT | CHARSET_MULTIBYTE | CHARSET_PRECOMPOSED,
+ NULL, NULL
};
/* ------------------------ */
35,
mac_turkish_pull,
mac_turkish_push,
- CHARSET_CLIENT | CHARSET_MULTIBYTE
+ CHARSET_CLIENT | CHARSET_MULTIBYTE,
+ NULL, NULL
};
static size_t mac_turkish_push( void *cd, char **inbuf, size_t *inbytesleft,
static struct charset_functions builtin_functions[] = {
- {"UCS-2", 0, iconv_copy, iconv_copy, CHARSET_WIDECHAR | CHARSET_PRECOMPOSED},
- {"ASCII", 0, ascii_pull, ascii_push, CHARSET_MULTIBYTE | CHARSET_PRECOMPOSED},
- {"SHIFT_JIS", 1568, NULL, NULL, CHARSET_ICONV | CHARSET_PRECOMPOSED | CHARSET_CLIENT},
- {NULL, 0, NULL, NULL, 0}
+ {"UCS-2", 0, iconv_copy, iconv_copy, CHARSET_WIDECHAR | CHARSET_PRECOMPOSED, NULL, NULL},
+ {"ASCII", 0, ascii_pull, ascii_push, CHARSET_MULTIBYTE | CHARSET_PRECOMPOSED, NULL, NULL},
+ {"SHIFT_JIS", 1568, NULL, NULL, CHARSET_ICONV | CHARSET_PRECOMPOSED | CHARSET_CLIENT, NULL, NULL},
+ {NULL, 0, NULL, NULL, 0, NULL, NULL}
};
0x08000103,
utf8_pull,
utf8_push,
- CHARSET_VOLUME | CHARSET_MULTIBYTE | CHARSET_PRECOMPOSED
+ CHARSET_VOLUME | CHARSET_MULTIBYTE | CHARSET_PRECOMPOSED,
+ NULL, NULL
};
struct charset_functions charset_utf8_mac =
0x08000103,
utf8_pull,
utf8_push,
- CHARSET_VOLUME | CHARSET_CLIENT | CHARSET_MULTIBYTE | CHARSET_DECOMPOSED
+ CHARSET_VOLUME | CHARSET_CLIENT | CHARSET_MULTIBYTE | CHARSET_DECOMPOSED,
+ NULL, NULL
};
/* ------------------------ */