diff -ruN util-linux-2.12r.orig/disk-utils/fsck.cramfs.c util-linux-2.12r/disk-utils/fsck.cramfs.c --- disk-utils/fsck.cramfs.c 2004-12-11 14:53:16.000000000 +0000 +++ disk-utils/fsck.cramfs.c 2006-03-21 06:02:06.428023000 +0000 @@ -454,7 +454,7 @@ int main(int argc, char **argv) { - void *buf; + int *buf; size_t length; struct stat st; u32 crc_old, crc_new; diff -ruN util-linux-2.12r.orig/disk-utils/mkfs.cramfs.c util-linux-2.12r/disk-utils/mkfs.cramfs.c --- disk-utils/mkfs.cramfs.c 2004-12-11 14:56:01.000000000 +0000 +++ disk-utils/mkfs.cramfs.c 2006-03-21 05:02:33.709009000 +0000 @@ -207,7 +207,7 @@ e->flags |= INVALID; } else { MD5Init(&ctx); - MD5Update(&ctx, start, e->size); + MD5Update(&ctx, (unsigned const char *) start, e->size); MD5Final(e->md5sum, &ctx); do_munmap(start, e->size, e->mode); @@ -612,7 +612,7 @@ input = blksize; size -= input; if (!is_zero (p, input)) { - compress(base + curr, &len, p, input); + compress((unsigned char *) base + curr, &len, (unsigned char *) p, input); curr += len; } p += input; @@ -880,7 +880,7 @@ sizeof(struct cramfs_super)); /* Put the checksum in. */ - crc = crc32(crc, (rom_image+opt_pad), (offset-opt_pad)); + crc = crc32(crc, (unsigned char *) (rom_image+opt_pad), (offset-opt_pad)); ((struct cramfs_super *) (rom_image+opt_pad))->fsid.crc = crc; if (verbose) printf(_("CRC: %x\n"), crc); diff -ruN util-linux-2.12r.orig/disk-utils/mkfs.minix.c util-linux-2.12r/disk-utils/mkfs.minix.c --- disk-utils/mkfs.minix.c 2004-08-24 22:32:36.000000000 +0000 +++ disk-utils/mkfs.minix.c 2006-03-21 03:59:50.181821000 +0000 @@ -592,7 +592,7 @@ die(_("can't open file of bad blocks")); while (!feof(listfile)) { - fscanf(listfile,"%ld\n", &blockno); + fscanf(listfile,"%lud\n", &blockno); mark_zone(blockno); badblocks++; } diff -ruN util-linux-2.12r.orig/disk-utils/mkswap.c util-linux-2.12r/disk-utils/mkswap.c --- disk-utils/mkswap.c 2004-12-21 17:21:24.000000000 +0000 +++ disk-utils/mkswap.c 2006-03-21 03:57:06.191821000 +0000 @@ -26,7 +26,7 @@ * V1_MAX_PAGES fixes, jj, 990325. * sparc64 fixes, jj, 000219. * - * 1999-02-22 Arkadiusz Mi¶kiewicz + * 1999-02-22 Arkadiusz Mikiewicz * - added Native Language Support * */ @@ -159,8 +159,8 @@ static int user_pagesize = 0; static int kernel_pagesize; /* obtained via getpagesize(); */ static int defined_pagesize = 0; /* PAGE_SIZE, when that exists */ -static int pagesize; -static long *signature_page; +static unsigned int pagesize; +static unsigned long *signature_page; struct swap_header_v1 *p; static void @@ -191,7 +191,7 @@ fprintf(stderr, _("Assuming pages of size %d (not %d)\n"), pagesize, defined_pagesize); - signature_page = (long *) malloc(pagesize); + signature_page = (unsigned long *) malloc(pagesize); memset(signature_page, 0, pagesize); p = (struct swap_header_v1 *) signature_page; } @@ -224,7 +224,7 @@ #endif static void -write_uuid_and_label(char *uuid, char *volume_name) { +write_uuid_and_label(unsigned char *uuid, char *volume_name) { struct swap_header_v1_2 *h; /* Sanity check */ @@ -505,7 +505,7 @@ char *block_count = 0; char *pp; char *opt_label = NULL; - char *uuid = NULL; + unsigned char *uuid = NULL; #ifdef HAVE_uuid_uuid_h uuid_t uuid_dat; #endif diff -ruN util-linux-2.12r.orig/fdisk/cfdisk.c util-linux-2.12r/fdisk/cfdisk.c --- fdisk/cfdisk.c 2006-03-21 03:41:22.000000000 +0000 +++ fdisk/cfdisk.c 2006-03-21 08:39:05.165179000 +0000 @@ -551,7 +551,7 @@ } static void -read_sector(char *buffer, long long sect_num) { +read_sector(unsigned char *buffer, long long sect_num) { if (ext2_llseek(fd, sect_num*SECTOR_SIZE, SEEK_SET) < 0) fatal(_("Cannot seek on disk drive"), 2); if (read(fd, buffer, SECTOR_SIZE) != SECTOR_SIZE) @@ -559,7 +559,7 @@ } static void -write_sector(char *buffer, long long sect_num) { +write_sector(unsigned char *buffer, long long sect_num) { if (ext2_llseek(fd, sect_num*SECTOR_SIZE, SEEK_SET) < 0) fatal(_("Cannot seek on disk drive"), 2); if (write(fd, buffer, SECTOR_SIZE) != SECTOR_SIZE) @@ -690,8 +690,8 @@ offset = (p_info[i].first_sector + p_info[i].offset) * SECTOR_SIZE + 0; if (ext2_llseek(fd, offset, SEEK_SET) == offset && read(fd, &xfsb, sizeof(xfsb)) == sizeof(xfsb) - && !strncmp(xfsb.s_magic, XFS_SUPER_MAGIC, 4)) { - label = xfsb.s_fname; + && !strncmp((char *) xfsb.s_magic, XFS_SUPER_MAGIC, 4)) { + label = (char *) xfsb.s_fname; for(j=0; jsectorbuffer)) { + if (!valid_part_table_flag((unsigned char *) pe->sectorbuffer)) { fprintf(stderr, _("Warning: invalid flag 0x%04x of partition " "table %d will be corrected by w(rite)\n"), - part_table_flag(pe->sectorbuffer), i + 1); + part_table_flag((unsigned char *) pe->sectorbuffer), i + 1); pe->changed = 1; } } @@ -2135,7 +2135,7 @@ struct pte *pe = &ptes[i]; if (pe->changed) { - write_part_table_flag(pe->sectorbuffer); + write_part_table_flag((unsigned char *) pe->sectorbuffer); write_sector(fd, pe->offset, pe->sectorbuffer); } } diff -ruN util-linux-2.12r.orig/fdisk/fdisk.h util-linux-2.12r/fdisk/fdisk.h --- fdisk/fdisk.h 2004-12-15 18:19:06.000000000 +0000 +++ fdisk/fdisk.h 2006-03-21 07:12:24.909640000 +0000 @@ -82,7 +82,7 @@ #define PLURAL 0 #define SINGULAR 1 -extern char *const str_units(int); +extern char * const str_units(int); extern unsigned int get_start_sect(struct partition *p); extern unsigned int get_nr_sects(struct partition *p); diff -ruN util-linux-2.12r.orig/fdisk/fdisksgilabel.c util-linux-2.12r/fdisk/fdisksgilabel.c --- fdisk/fdisksgilabel.c 2004-12-18 01:53:45.000000000 +0000 +++ fdisk/fdisksgilabel.c 2006-03-21 07:23:57.411621000 +0000 @@ -246,7 +246,7 @@ if (sgilabel->directory[i].vol_file_size) { __u32 start = SSWAP32(sgilabel->directory[i].vol_file_start); __u32 len = SSWAP32(sgilabel->directory[i].vol_file_size); - char *name = sgilabel->directory[i].vol_file_name; + char *name = (char *) sgilabel->directory[i].vol_file_name; printf(_("%2d: %-10s sector%5u size%8u\n"), i, name, (unsigned int) start, (unsigned int) len); @@ -318,7 +318,7 @@ } } } - if (strncmp(aFile, sgilabel->boot_file, 16)) { + if (strncmp(aFile, (char *) sgilabel->boot_file, 16)) { printf(_("\n\tBe aware, that the bootfile is not checked for existence.\n\t" "SGI's default is \"/unix\" and for backup \"/unix.save\".\n")); /* filename is correct and did change */ @@ -329,7 +329,7 @@ const char * sgi_get_bootfile(void) { - return sgilabel->boot_file; + return (char *) sgilabel->boot_file; } void @@ -355,7 +355,7 @@ /* I keep SGI's habit to write the sgilabel to the second block */ sgilabel->directory[0].vol_file_start = SSWAP32(2); sgilabel->directory[0].vol_file_size = SSWAP32(sizeof(sgiinfo)); - strncpy(sgilabel->directory[0].vol_file_name, "sgilabel", 8); + strncpy((char *)sgilabel->directory[0].vol_file_name, "sgilabel", 8); } sgiinfo *fill_sgiinfo(void); @@ -372,7 +372,7 @@ fatal(unable_to_seek); if (write(fd, sgilabel, SECTOR_SIZE) != SECTOR_SIZE) fatal(unable_to_write); - if (! strncmp(sgilabel->directory[0].vol_file_name, "sgilabel", 8)) { + if (! strncmp((char *) sgilabel->directory[0].vol_file_name, "sgilabel", 8)) { /* * keep this habit of first writing the "sgilabel". * I never tested whether it works without (AN 981002). @@ -733,7 +733,7 @@ } for (i = 0; i < 4; i++) { old[i].sysid = 0; - if (valid_part_table_flag(MBRbuffer)) { + if (valid_part_table_flag((unsigned char *) MBRbuffer)) { if (get_part_table(i)->sys_ind) { old[i].sysid = get_part_table(i)->sys_ind; old[i].start = get_start_sect(get_part_table(i)); @@ -753,7 +753,7 @@ /* sizeof(sgilabel->boot_file) = 16 > 6 */ memset(sgilabel->boot_file, 0, 16); - strcpy(sgilabel->boot_file, "/unix"); + strcpy((char *) sgilabel->boot_file, "/unix"); sgilabel->devparam.skew = (0); sgilabel->devparam.gap1 = (0); @@ -837,9 +837,9 @@ info->b2=SSWAP16(-1); info->b3=SSWAP16(1); /* You may want to replace this string !!!!!!! */ - strcpy(info->scsi_string, "IBM OEM 0662S12 3 30"); - strcpy(info->serial, "0000"); + strcpy((char *) info->scsi_string, "IBM OEM 0662S12 3 30"); + strcpy((char *) info->serial, "0000"); info->check1816 = SSWAP16(18*256 +16); - strcpy(info->installer, "Sfx version 5.3, Oct 18, 1994"); + strcpy((char *) info->installer, "Sfx version 5.3, Oct 18, 1994"); return info; } diff -ruN util-linux-2.12r.orig/fdisk/fdisksunlabel.c util-linux-2.12r/fdisk/fdisksunlabel.c --- fdisk/fdisksunlabel.c 2004-12-22 15:36:24.000000000 +0000 +++ fdisk/fdisksunlabel.c 2006-03-21 07:18:25.941621000 +0000 @@ -348,7 +348,7 @@ puts(_("You may change all the disk params from the x menu")); } - snprintf(sunlabel->info, sizeof(sunlabel->info), + snprintf((char *) sunlabel->info, sizeof(sunlabel->info), "%s%s%s cyl %d alt %d hd %d sec %d", p ? p->vendor : "", (p && *p->vendor) ? " " : "", p ? p->model diff -ruN util-linux-2.12r.orig/fdisk/sfdisk.c util-linux-2.12r/fdisk/sfdisk.c --- fdisk/sfdisk.c 2005-01-04 22:31:57.000000000 +0000 +++ fdisk/sfdisk.c 2006-03-21 08:40:35.762635000 +0000 @@ -265,7 +265,7 @@ static int msdos_signature (struct sector *s) { - unsigned char *data = s->data; + unsigned char *data = (unsigned char *) s->data; if (data[510] == 0x55 && data[511] == 0xaa) return 1; error(_("ERROR: sector %lu does not have an msdos signature\n"), @@ -392,7 +392,7 @@ ss0 = ss; ct = statbuf.st_size/516; while(ct--) { - sno = chars_to_ulong(ss); + sno = chars_to_ulong((unsigned char *) ss); if (!sseek(dev, fdout, sno)) return 0; if (write(fdout, ss+4, 512) != 512) { @@ -718,8 +718,8 @@ p->end_chs.h = *cp++; p->end_chs.s = *cp++; p->end_chs.c = *cp++; - p->start_sect = copy_to_int(cp); - p->nr_sects = copy_to_int(cp+4); + p->start_sect = copy_to_int((unsigned char *) cp); + p->nr_sects = copy_to_int((unsigned char *) cp+4); } static void @@ -1716,6 +1716,7 @@ read_stdin(unsigned char **fields, unsigned char *line, int fieldssize, int linesize) { unsigned char *lp, *ip; int c, fno; + char *line_plus2 = (char *) line + 2; /* boolean true and empty string at start */ line[0] = '*'; @@ -1725,27 +1726,27 @@ fno = 0; /* read a line from stdin */ - lp = fgets(line+2, linesize, stdin); + lp = (unsigned char *) fgets(line_plus2, linesize, stdin); if (lp == NULL) { eof = 1; return RD_EOF; } - if (!(lp = index(lp, '\n'))) + if (!(lp = (unsigned char *) index((char *) lp, '\n'))) fatal(_("long or incomplete input line - quitting\n")); *lp = 0; /* remove comments, if any */ - if ((lp = index(line+2, '#')) != 0) + if ((lp = (unsigned char *) index(line_plus2, '#')) != 0) *lp = 0; /* recognize a few commands - to be expanded */ - if (!strcmp(line+2, "unit: sectors")) { + if (!strcmp(line_plus2, "unit: sectors")) { specified_format = F_SECTOR; return RD_CMD; } /* dump style? - then bad input is fatal */ - if ((ip = index(line+2, ':')) != 0) { + if ((ip = (unsigned char *) index(line_plus2, ':')) != 0) { struct dumpfld *d; nxtfld: @@ -1755,7 +1756,7 @@ if (*ip == 0) return fno; for(d = dumpflds; d-dumpflds < SIZE(dumpflds); d++) { - if (!strncmp(ip, d->fldname, strlen(d->fldname))) { + if (!strncmp((char *) ip, d->fldname, strlen((char *) d->fldname))) { ip += strlen(d->fldname); while(isspace(*ip)) ip++; @@ -2037,7 +2038,7 @@ return 0; } - if (fno == 1 && !strcmp(fields[0], ".")) { + if (fno == 1 && !strcmp((char *) fields[0], ".")) { eob = 1; return -1; } @@ -2075,15 +2076,15 @@ ul = orig ? orig->p.sys_type : (is_extd || (pno > 3 && pct == 1 && show_extended)) ? EXTENDED_PARTITION : LINUX_NATIVE; - else if (!strcmp(fields[2], "L")) + else if (!strcmp((char *) fields[2], "L")) ul = LINUX_NATIVE; - else if (!strcmp(fields[2], "S")) + else if (!strcmp((char *) fields[2], "S")) ul = LINUX_SWAP; - else if (!strcmp(fields[2], "E")) + else if (!strcmp((char *) fields[2], "E")) ul = EXTENDED_PARTITION; - else if (!strcmp(fields[2], "X")) + else if (!strcmp((char *) fields[2], "X")) ul = LINUX_EXTENDED; - else if (get_ul(fields[2], &ul, LINUX_NATIVE, 16)) + else if (get_ul((char *) fields[2], &ul, LINUX_NATIVE, 16)) return 0; if (ul > 255) { warn(_("Illegal type\n")); @@ -2099,7 +2100,7 @@ if (fno < 1 || !*(fields[0])) p.start = def; else { - if (get_ul(fields[0], &ul, def / unitsize(0), 0)) + if (get_ul((char *) fields[0], &ul, def / unitsize(0), 0)) return 0; p.start = ul * unitsize(0); p.start -= (p.start % unitsize(format)); @@ -2112,7 +2113,7 @@ if (fno < 2 || !*(fields[1])) p.size = def; else { - if (get_ul(fields[1], &ul, def / unitsize(0), 0)) + if (get_ul((char *) fields[1], &ul, def / unitsize(0), 0)) return 0; p.size = ul * unitsize(0) + unitsize(format) - 1; p.size -= (p.size % unitsize(format)); @@ -2146,9 +2147,9 @@ if (fno < 4 || !*(fields[3])) ul = (orig ? orig->p.bootable : 0); - else if (!strcmp(fields[3], "-")) + else if (!strcmp((char *) fields[3], "-")) ul = 0; - else if (!strcmp(fields[3], "*") || !strcmp(fields[3], "+")) + else if (!strcmp((char *) fields[3], "*") || !strcmp((char *) fields[3], "+")) ul = 0x80; else { warn(_("unrecognized bootable flag - choose - or *\n")); @@ -2170,9 +2171,9 @@ } else if (fno < 7) { warn(_("partial c,h,s specification?\n")); return 0; - } else if (get_ul(fields[4], &bb.c, aa.c, 0) || - get_ul(fields[5], &bb.h, aa.h, 0) || - get_ul(fields[6], &bb.s, aa.s, 0)) + } else if (get_ul((char *) fields[4], &bb.c, aa.c, 0) || + get_ul((char *) fields[5], &bb.h, aa.h, 0) || + get_ul((char *) fields[6], &bb.s, aa.s, 0)) return 0; p.p.begin_chs = longchs_to_chs(bb,B); } @@ -2183,9 +2184,9 @@ } else if (fno < 10) { warn(_("partial c,h,s specification?\n")); return 0; - } else if (get_ul(fields[7], &bb.c, aa.c, 0) || - get_ul(fields[8], &bb.h, aa.h, 0) || - get_ul(fields[9], &bb.s, aa.s, 0)) + } else if (get_ul((char *) fields[7], &bb.c, aa.c, 0) || + get_ul((char *) fields[8], &bb.h, aa.h, 0) || + get_ul((char *) fields[9], &bb.s, aa.s, 0)) return 0; p.p.end_chs = longchs_to_chs(bb, B); } diff -ruN util-linux-2.12r.orig/misc-utils/ddate.c util-linux-2.12r/misc-utils/ddate.c --- misc-utils/ddate.c 2004-09-06 21:12:40.000000000 +0000 +++ misc-utils/ddate.c 2006-03-21 05:10:25.819009000 +0000 @@ -26,7 +26,7 @@ 59 Bcy, 3161: PRAISE_BOB and KILL_BOB options split, other minor changes. - 1999-02-22 Arkadiusz Mi¶kiewicz + 1999-02-22 Arkadiusz Mikiewicz - added Native Language Support 2000-03-17 Burt Holzman @@ -111,7 +111,7 @@ /* randomness, from the Net and other places. Feel free to add (after checking with the relevant authorities, of course). */ "Grudnuk demand sustenance!", "Keep the Lasagna flying!", - "Umlaut Zebra über alles!", "You are what you see.", + "Umlaut Zebra ber alles!", "You are what you see.", "Or is it?", "This statement is false.", #if defined(linux) || defined (__linux__) || defined (__linux) "Hail Eris, Hack Linux!", @@ -299,6 +299,9 @@ /* basic range checks */ if (imonth < 1 || imonth > 12) { funkychickens.season = -1; + funkychickens.day = -1; + funkychickens.yday = -1; + funkychickens.year = -1; return funkychickens; } if (iday < 1 || iday > cal[imonth-1]) { diff -ruN util-linux-2.12r.orig/misc-utils/script.c util-linux-2.12r/misc-utils/script.c --- misc-utils/script.c 2004-03-26 17:07:16.000000000 +0000 +++ misc-utils/script.c 2006-03-21 05:17:09.499009000 +0000 @@ -32,7 +32,7 @@ */ /* - * 1999-02-22 Arkadiusz Mi¶kiewicz + * 1999-02-22 Arkadiusz Mikiewicz * - added Native Language Support * * 2000-07-30 Per Andreas Buer - added "q"-option @@ -325,9 +325,9 @@ shname = shell; if (cflg) - execl(shell, shname, "-c", cflg, 0); + execl(shell, shname, "-c", cflg, (char *) 0); else - execl(shell, shname, "-i", 0); + execl(shell, shname, "-i", (char *) 0); perror(shell); fail(); diff -ruN util-linux-2.12r.orig/misc-utils/setterm.c util-linux-2.12r/misc-utils/setterm.c --- misc-utils/setterm.c 2003-10-17 16:17:51.000000000 +0000 +++ misc-utils/setterm.c 2006-03-21 05:22:02.687012000 +0000 @@ -16,7 +16,7 @@ * * Converted to terminfo by Kars de Jong (jongk@cs.utwente.nl) * - * 1999-02-22 Arkadiusz Mi¶kiewicz + * 1999-02-22 Arkadiusz Mikiewicz * - added Native Language Support * * @@ -1183,7 +1183,7 @@ cols = screenbuf[1]; for (i=0; i 6th April 2001. -// -// This is an implementation of the AES encryption algorithm (Rijndael) -// designed by Joan Daemen and Vincent Rijmen. This version is designed -// to provide both fixed and dynamic block and key lengths and can also -// run with either big or little endian internal byte order (see aes.h). -// It inputs block and key lengths in bytes with the legal values being -// 16, 24 and 32. +/* + * I retain copyright in this code but I encourage its free use provided + * that I don't carry any responsibility for the results. I am especially + * happy to see it used in free and open source software. If you do use + * it I would appreciate an acknowledgement of its origin in the code or + * the product that results and I would also appreciate knowing a little + * about the use to which it is being put. I am grateful to Frank Yellin + * for some ideas that are used in this implementation. + * + * Dr B. R. Gladman 6th April 2001. + * + * This is an implementation of the AES encryption algorithm (Rijndael) + * designed by Joan Daemen and Vincent Rijmen. This version is designed + * to provide both fixed and dynamic block and key lengths and can also + * run with either big or little endian internal byte order (see aes.h). + * It inputs block and key lengths in bytes with the legal values being + * 16, 24 and 32. + */ /* * Modified by Jari Ruusu, May 1 2001 @@ -44,9 +46,11 @@ #error an illegal block size has been specified #endif -// upr(x,n): rotates bytes within words by n positions, moving bytes -// to higher index positions with wrap around into low positions -// bval(x,n): extracts a byte from a word +/* + * upr(x,n): rotates bytes within words by n positions, moving bytes + * to higher index positions with wrap around into low positions + * bval(x,n): extracts a byte from a word + */ #define upr(x,n) (((x) << 8 * (n)) | ((x) >> (32 - 8 * (n)))) #define bval(x,n) ((unsigned char)((x) >> 8 * (n))) @@ -63,26 +67,27 @@ #define word_out(x,v) ((unsigned char *)(x))[0]=(v),((unsigned char *)(x))[1]=((v)>>8),((unsigned char *)(x))[2]=((v)>>16),((unsigned char *)(x))[3]=((v)>>24) #endif -// the finite field modular polynomial and elements +/* the finite field modular polynomial and elements */ #define ff_poly 0x011b #define ff_hi 0x80 static int tab_gen = 0; -static unsigned char s_box[256]; // the S box -static u_int32_t rcon_tab[AES_RC_LENGTH]; // table of round constants +static unsigned char s_box[256]; /* the S box */ +static u_int32_t rcon_tab[AES_RC_LENGTH]; /* table of round constants */ static u_int32_t ft_tab[4][256]; static u_int32_t fl_tab[4][256]; -// Generate the tables for the dynamic table option - -// It will generally be sensible to use tables to compute finite -// field multiplies and inverses but where memory is scarse this -// code might sometimes be better. - -// return 2 ^ (n - 1) where n is the bit number of the highest bit -// set in x with x in the range 1 < x < 0x00000200. This form is -// used so that locals within FFinv can be bytes rather than words +/* Generate the tables for the dynamic table option + * + * It will generally be sensible to use tables to compute finite + * field multiplies and inverses but where memory is scarse this + * code might sometimes be better. + * + * return 2 ^ (n - 1) where n is the bit number of the highest bit + * set in x with x in the range 1 < x < 0x00000200. This form is + * used so that locals within FFinv can be bytes rather than words + */ static unsigned char hibit(const u_int32_t x) { unsigned char r = (unsigned char)((x >> 1) | (x >> 2)); @@ -92,7 +97,7 @@ return (r + 1) >> 1; } -// return the inverse of the finite field element x +/* return the inverse of the finite field element x */ static unsigned char FFinv(const unsigned char x) { unsigned char p1 = x, p2 = 0x1b, n1 = hibit(x), n2 = 0x80, v1 = 1, v2 = 0; @@ -117,12 +122,12 @@ } } -// define the finite field multiplies required for Rijndael +/* define the finite field multiplies required for Rijndael */ #define FFmul02(x) ((((x) & 0x7f) << 1) ^ ((x) & 0x80 ? 0x1b : 0)) #define FFmul03(x) ((x) ^ FFmul02(x)) -// The forward and inverse affine transformations used in the S-box +/* The forward and inverse affine transformations used in the S-box */ #define fwd_affine(x) \ (w = (u_int32_t)x, w ^= (w<<1)^(w<<2)^(w<<3)^(w<<4), 0x63^(unsigned char)(w^(w>>8))) @@ -168,10 +173,12 @@ #define nc (AES_BLOCK_SIZE / 4) -// Initialise the key schedule from the user supplied key. -// The key length is now specified in bytes, 32. -// This corresponds to bit length of 256 bits, and -// to Nk value of 8 respectively. +/* + * Initialise the key schedule from the user supplied key. + * The key length is now specified in bytes, 32. + * This corresponds to bit length of 256 bits, and + * to Nk value of 8 respectively. + */ void aes_set_key(aes_context *cx, const unsigned char in_key[], int n_bytes, const int f) { u_int32_t *kf, *kt, rci; @@ -212,19 +219,23 @@ } } -// y = output word, x = input word, r = row, c = column -// for r = 0, 1, 2 and 3 = column accessed for row r +/* + * y = output word, x = input word, r = row, c = column + * for r = 0, 1, 2 and 3 = column accessed for row r + */ #define s(x,c) x[c] -// I am grateful to Frank Yellin for the following constructions -// which, given the column (c) of the output state variable that -// is being computed, return the input state variables which are -// needed for each row (r) of the state - -// For the fixed block size options, compilers reduce these two -// expressions to fixed variable references. For variable block -// size code conditional clauses will sometimes be returned +/* + * I am grateful to Frank Yellin for the following constructions + * which, given the column (c) of the output state variable that + * is being computed, return the input state variables which are + * needed for each row (r) of the state + * + * For the fixed block size options, compilers reduce these two + * expressions to fixed variable references. For variable block + * size code conditional clauses will sometimes be returned + */ #define fwd_var(x,r,c) \ ( r==0 ? \ diff -ruN util-linux-2.12r.orig/mount/aes.h util-linux-2.12r/mount/aes.h --- mount/aes.h 2006-03-21 03:41:21.000000000 +0000 +++ mount/aes.h 2006-03-21 05:34:23.877012000 +0000 @@ -1,19 +1,21 @@ -// I retain copyright in this code but I encourage its free use provided -// that I don't carry any responsibility for the results. I am especially -// happy to see it used in free and open source software. If you do use -// it I would appreciate an acknowledgement of its origin in the code or -// the product that results and I would also appreciate knowing a little -// about the use to which it is being put. I am grateful to Frank Yellin -// for some ideas that are used in this implementation. -// -// Dr B. R. Gladman 6th April 2001. -// -// This is an implementation of the AES encryption algorithm (Rijndael) -// designed by Joan Daemen and Vincent Rijmen. This version is designed -// to provide both fixed and dynamic block and key lengths and can also -// run with either big or little endian internal byte order (see aes.h). -// It inputs block and key lengths in bytes with the legal values being -// 16, 24 and 32. +/* + * I retain copyright in this code but I encourage its free use provided + * that I don't carry any responsibility for the results. I am especially + * happy to see it used in free and open source software. If you do use + * it I would appreciate an acknowledgement of its origin in the code or + * the product that results and I would also appreciate knowing a little + * about the use to which it is being put. I am grateful to Frank Yellin + * for some ideas that are used in this implementation. + * + * Dr B. R. Gladman 6th April 2001. + * + * This is an implementation of the AES encryption algorithm (Rijndael) + * designed by Joan Daemen and Vincent Rijmen. This version is designed + * to provide both fixed and dynamic block and key lengths and can also + * run with either big or little endian internal byte order (see aes.h). + * It inputs block and key lengths in bytes with the legal values being + * 16, 24 and 32. + */ /* * Modified by Jari Ruusu, May 1 2001 @@ -41,25 +43,29 @@ # include #endif -// CONFIGURATION OPTIONS (see also aes.c) -// -// Define AES_BLOCK_SIZE to set the cipher block size (16, 24 or 32) or -// leave this undefined for dynamically variable block size (this will -// result in much slower code). -// IMPORTANT NOTE: AES_BLOCK_SIZE is in BYTES (16, 24, 32 or undefined). If -// left undefined a slower version providing variable block length is compiled +/* + * CONFIGURATION OPTIONS (see also aes.c) + * + * Define AES_BLOCK_SIZE to set the cipher block size (16, 24 or 32) or + * leave this undefined for dynamically variable block size (this will + * result in much slower code). + * IMPORTANT NOTE: AES_BLOCK_SIZE is in BYTES (16, 24, 32 or undefined). If + * left undefined a slower version providing variable block length is compiled + */ #define AES_BLOCK_SIZE 16 -// The number of key schedule words for different block and key lengths -// allowing for method of computation which requires the length to be a -// multiple of the key length -// -// Nk = 4 6 8 -// ------------- -// Nb = 4 | 60 60 64 -// 6 | 96 90 96 -// 8 | 120 120 120 +/* + * The number of key schedule words for different block and key lengths + * allowing for method of computation which requires the length to be a + * multiple of the key length + * + * Nk = 4 6 8 + * ------------- + * Nb = 4 | 60 60 64 + * 6 | 96 90 96 + * 8 | 120 120 120 + */ #if !defined(AES_BLOCK_SIZE) || (AES_BLOCK_SIZE == 32) #define AES_KS_LENGTH 120 @@ -71,16 +77,16 @@ typedef struct { - u_int32_t aes_Nkey; // the number of words in the key input block - u_int32_t aes_Nrnd; // the number of cipher rounds - u_int32_t aes_e_key[AES_KS_LENGTH]; // the encryption key schedule - u_int32_t aes_d_key[AES_KS_LENGTH]; // the decryption key schedule + u_int32_t aes_Nkey; /* the number of words in the key input block */ + u_int32_t aes_Nrnd; /* the number of cipher rounds */ + u_int32_t aes_e_key[AES_KS_LENGTH]; /* the encryption key schedule */ + u_int32_t aes_d_key[AES_KS_LENGTH]; /* the decryption key schedule */ #if !defined(AES_BLOCK_SIZE) - u_int32_t aes_Ncol; // the number of columns in the cipher state + u_int32_t aes_Ncol; /* the number of columns in the cipher state */ #endif } aes_context; -// THE CIPHER INTERFACE +/* THE CIPHER INTERFACE */ #if !defined(AES_BLOCK_SIZE) extern void aes_set_blk(aes_context *, const int); @@ -89,9 +95,11 @@ extern void aes_encrypt(const aes_context *, const unsigned char [], unsigned char []); extern void aes_decrypt(const aes_context *, const unsigned char [], unsigned char []); -// The block length inputs to aes_set_block and aes_set_key are in numbers -// of bytes or bits. The calls to subroutines must be made in the above -// order but multiple calls can be made without repeating earlier calls -// if their parameters have not changed. +/* + * The block length inputs to aes_set_block and aes_set_key are in numbers + * of bytes or bits. The calls to subroutines must be made in the above + * order but multiple calls can be made without repeating earlier calls + * if their parameters have not changed. + */ -#endif // _AES_H +#endif /* _AES_H */ diff -ruN util-linux-2.12r.orig/mount/mntent.c util-linux-2.12r/mount/mntent.c --- mount/mntent.c 2004-10-13 20:57:34.000000000 +0000 +++ mount/mntent.c 2006-03-21 05:26:20.447012000 +0000 @@ -1,7 +1,7 @@ /* Private version of the libc *mntent() routines. */ /* Note slightly different prototypes. */ -/* 1999-02-22 Arkadiusz Mi¶kiewicz +/* 1999-02-22 Arkadiusz Mikiewicz * - added Native Language Support */ @@ -25,7 +25,7 @@ char *ss, *sp; int n; - n = strlen(s); + n = strlen((char *) s); ss = sp = xmalloc(4*n+1); while(1) { for (n = 0; n < sizeof(need_escaping); n++) { @@ -126,10 +126,10 @@ if (fseek (mfp->mntent_fp, 0, SEEK_END)) return 1; /* failure */ - m1 = mangle(mnt->mnt_fsname); - m2 = mangle(mnt->mnt_dir); - m3 = mangle(mnt->mnt_type); - m4 = mangle(mnt->mnt_opts); + m1 = mangle((char *) mnt->mnt_fsname); + m2 = mangle((char *) mnt->mnt_dir); + m3 = mangle((char *) mnt->mnt_type); + m4 = mangle((char *) mnt->mnt_opts); res = fprintf (mfp->mntent_fp, "%s %s %s %s %d %d\n", m1, m2, m3, m4, mnt->mnt_freq, mnt->mnt_passno); diff -ruN util-linux-2.12r.orig/mount/nfsmount.h util-linux-2.12r/mount/nfsmount.h --- mount/nfsmount.h 1970-01-01 00:00:00.000000000 +0000 +++ mount/nfsmount.h 2006-03-21 05:28:32.197012000 +0000 @@ -0,0 +1,328 @@ +/* + * Please do not edit this file. + * It was generated using rpcgen. + */ + +#ifndef _NFSMOUNT_H_RPCGEN +#define _NFSMOUNT_H_RPCGEN + +#include + + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Sun RPC is a product of Sun Microsystems, Inc. and is provided for + * unrestricted use provided that this legend is included on all tape + * media and as a part of the software program in whole or part. Users + * may copy or modify Sun RPC without charge, but are not authorized + * to license or distribute it to anyone else except as part of a product or + * program developed by the user or with the express written consent of + * Sun Microsystems, Inc. + * + * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE + * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR + * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. + * + * Sun RPC is provided with no support and without any obligation on the + * part of Sun Microsystems, Inc. to assist in its use, correction, + * modification or enhancement. + * + * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE + * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC + * OR ANY PART THEREOF. + * + * In no event will Sun Microsystems, Inc. be liable for any lost revenue + * or profits or other special, indirect and consequential damages, even if + * Sun has been advised of the possibility of such damages. + * + * Sun Microsystems, Inc. + * 2550 Garcia Avenue + * Mountain View, California 94043 + */ +/* + * Copyright (c) 1985, 1990 by Sun Microsystems, Inc. + */ + +/* from @(#)mount.x 1.3 91/03/11 TIRPC 1.0 */ +#ifndef _rpcsvc_mount_h +#define _rpcsvc_mount_h +#include +#define MNTPATHLEN 1024 +#define MNTNAMLEN 255 +#define FHSIZE 32 +#define FHSIZE3 64 + +typedef char fhandle[FHSIZE]; + +typedef struct { + u_int fhandle3_len; + char *fhandle3_val; +} fhandle3; + +enum mountstat3 { + MNT_OK = 0, + MNT3ERR_PERM = 1, + MNT3ERR_NOENT = 2, + MNT3ERR_IO = 5, + MNT3ERR_ACCES = 13, + MNT3ERR_NOTDIR = 20, + MNT3ERR_INVAL = 22, + MNT3ERR_NAMETOOLONG = 63, + MNT3ERR_NOTSUPP = 10004, + MNT3ERR_SERVERFAULT = 10006 +}; +typedef enum mountstat3 mountstat3; + +struct fhstatus { + u_int fhs_status; + union { + fhandle fhs_fhandle; + } fhstatus_u; +}; +typedef struct fhstatus fhstatus; + +struct mountres3_ok { + fhandle3 fhandle; + struct { + u_int auth_flavours_len; + int *auth_flavours_val; + } auth_flavours; +}; +typedef struct mountres3_ok mountres3_ok; + +struct mountres3 { + mountstat3 fhs_status; + union { + mountres3_ok mountinfo; + } mountres3_u; +}; +typedef struct mountres3 mountres3; + +typedef char *dirpath; + +typedef char *name; + +typedef struct mountbody *mountlist; + +struct mountbody { + name ml_hostname; + dirpath ml_directory; + mountlist ml_next; +}; +typedef struct mountbody mountbody; + +typedef struct groupnode *groups; + +struct groupnode { + name gr_name; + groups gr_next; +}; +typedef struct groupnode groupnode; + +typedef struct exportnode *exports; + +struct exportnode { + dirpath ex_dir; + groups ex_groups; + exports ex_next; +}; +typedef struct exportnode exportnode; + +struct ppathcnf { + int pc_link_max; + short pc_max_canon; + short pc_max_input; + short pc_name_max; + short pc_path_max; + short pc_pipe_buf; + u_char pc_vdisable; + char pc_xxx; + short pc_mask[2]; +}; +typedef struct ppathcnf ppathcnf; +#endif /*!_rpcsvc_mount_h*/ + +#define MOUNTPROG 100005 +#define MOUNTVERS 1 + +#if defined(__STDC__) || defined(__cplusplus) +#define MOUNTPROC_NULL 0 +extern void * mountproc_null_1(void *, CLIENT *); +extern void * mountproc_null_1_svc(void *, struct svc_req *); +#define MOUNTPROC_MNT 1 +extern fhstatus * mountproc_mnt_1(dirpath *, CLIENT *); +extern fhstatus * mountproc_mnt_1_svc(dirpath *, struct svc_req *); +#define MOUNTPROC_DUMP 2 +extern mountlist * mountproc_dump_1(void *, CLIENT *); +extern mountlist * mountproc_dump_1_svc(void *, struct svc_req *); +#define MOUNTPROC_UMNT 3 +extern void * mountproc_umnt_1(dirpath *, CLIENT *); +extern void * mountproc_umnt_1_svc(dirpath *, struct svc_req *); +#define MOUNTPROC_UMNTALL 4 +extern void * mountproc_umntall_1(void *, CLIENT *); +extern void * mountproc_umntall_1_svc(void *, struct svc_req *); +#define MOUNTPROC_EXPORT 5 +extern exports * mountproc_export_1(void *, CLIENT *); +extern exports * mountproc_export_1_svc(void *, struct svc_req *); +#define MOUNTPROC_EXPORTALL 6 +extern exports * mountproc_exportall_1(void *, CLIENT *); +extern exports * mountproc_exportall_1_svc(void *, struct svc_req *); +extern int mountprog_1_freeresult (SVCXPRT *, xdrproc_t, caddr_t); + +#else /* K&R C */ +#define MOUNTPROC_NULL 0 +extern void * mountproc_null_1(); +extern void * mountproc_null_1_svc(); +#define MOUNTPROC_MNT 1 +extern fhstatus * mountproc_mnt_1(); +extern fhstatus * mountproc_mnt_1_svc(); +#define MOUNTPROC_DUMP 2 +extern mountlist * mountproc_dump_1(); +extern mountlist * mountproc_dump_1_svc(); +#define MOUNTPROC_UMNT 3 +extern void * mountproc_umnt_1(); +extern void * mountproc_umnt_1_svc(); +#define MOUNTPROC_UMNTALL 4 +extern void * mountproc_umntall_1(); +extern void * mountproc_umntall_1_svc(); +#define MOUNTPROC_EXPORT 5 +extern exports * mountproc_export_1(); +extern exports * mountproc_export_1_svc(); +#define MOUNTPROC_EXPORTALL 6 +extern exports * mountproc_exportall_1(); +extern exports * mountproc_exportall_1_svc(); +extern int mountprog_1_freeresult (); +#endif /* K&R C */ +#define MOUNTVERS_POSIX 2 + +#if defined(__STDC__) || defined(__cplusplus) +extern void * mountproc_null_2(void *, CLIENT *); +extern void * mountproc_null_2_svc(void *, struct svc_req *); +extern fhstatus * mountproc_mnt_2(dirpath *, CLIENT *); +extern fhstatus * mountproc_mnt_2_svc(dirpath *, struct svc_req *); +extern mountlist * mountproc_dump_2(void *, CLIENT *); +extern mountlist * mountproc_dump_2_svc(void *, struct svc_req *); +extern void * mountproc_umnt_2(dirpath *, CLIENT *); +extern void * mountproc_umnt_2_svc(dirpath *, struct svc_req *); +extern void * mountproc_umntall_2(void *, CLIENT *); +extern void * mountproc_umntall_2_svc(void *, struct svc_req *); +extern exports * mountproc_export_2(void *, CLIENT *); +extern exports * mountproc_export_2_svc(void *, struct svc_req *); +extern exports * mountproc_exportall_2(void *, CLIENT *); +extern exports * mountproc_exportall_2_svc(void *, struct svc_req *); +#define MOUNTPROC_PATHCONF 7 +extern ppathcnf * mountproc_pathconf_2(dirpath *, CLIENT *); +extern ppathcnf * mountproc_pathconf_2_svc(dirpath *, struct svc_req *); +extern int mountprog_2_freeresult (SVCXPRT *, xdrproc_t, caddr_t); + +#else /* K&R C */ +extern void * mountproc_null_2(); +extern void * mountproc_null_2_svc(); +extern fhstatus * mountproc_mnt_2(); +extern fhstatus * mountproc_mnt_2_svc(); +extern mountlist * mountproc_dump_2(); +extern mountlist * mountproc_dump_2_svc(); +extern void * mountproc_umnt_2(); +extern void * mountproc_umnt_2_svc(); +extern void * mountproc_umntall_2(); +extern void * mountproc_umntall_2_svc(); +extern exports * mountproc_export_2(); +extern exports * mountproc_export_2_svc(); +extern exports * mountproc_exportall_2(); +extern exports * mountproc_exportall_2_svc(); +#define MOUNTPROC_PATHCONF 7 +extern ppathcnf * mountproc_pathconf_2(); +extern ppathcnf * mountproc_pathconf_2_svc(); +extern int mountprog_2_freeresult (); +#endif /* K&R C */ +#define MOUNT_V3 3 + +#if defined(__STDC__) || defined(__cplusplus) +#define MOUNTPROC3_NULL 0 +extern void * mountproc3_null_3(void *, CLIENT *); +extern void * mountproc3_null_3_svc(void *, struct svc_req *); +#define MOUNTPROC3_MNT 1 +extern mountres3 * mountproc3_mnt_3(dirpath *, CLIENT *); +extern mountres3 * mountproc3_mnt_3_svc(dirpath *, struct svc_req *); +#define MOUNTPROC3_DUMP 2 +extern mountlist * mountproc3_dump_3(void *, CLIENT *); +extern mountlist * mountproc3_dump_3_svc(void *, struct svc_req *); +#define MOUNTPROC3_UMNT 3 +extern void * mountproc3_umnt_3(dirpath *, CLIENT *); +extern void * mountproc3_umnt_3_svc(dirpath *, struct svc_req *); +#define MOUNTPROC3_UMNTALL 4 +extern void * mountproc3_umntall_3(void *, CLIENT *); +extern void * mountproc3_umntall_3_svc(void *, struct svc_req *); +#define MOUNTPROC3_EXPORT 5 +extern exports * mountproc3_export_3(void *, CLIENT *); +extern exports * mountproc3_export_3_svc(void *, struct svc_req *); +extern int mountprog_3_freeresult (SVCXPRT *, xdrproc_t, caddr_t); + +#else /* K&R C */ +#define MOUNTPROC3_NULL 0 +extern void * mountproc3_null_3(); +extern void * mountproc3_null_3_svc(); +#define MOUNTPROC3_MNT 1 +extern mountres3 * mountproc3_mnt_3(); +extern mountres3 * mountproc3_mnt_3_svc(); +#define MOUNTPROC3_DUMP 2 +extern mountlist * mountproc3_dump_3(); +extern mountlist * mountproc3_dump_3_svc(); +#define MOUNTPROC3_UMNT 3 +extern void * mountproc3_umnt_3(); +extern void * mountproc3_umnt_3_svc(); +#define MOUNTPROC3_UMNTALL 4 +extern void * mountproc3_umntall_3(); +extern void * mountproc3_umntall_3_svc(); +#define MOUNTPROC3_EXPORT 5 +extern exports * mountproc3_export_3(); +extern exports * mountproc3_export_3_svc(); +extern int mountprog_3_freeresult (); +#endif /* K&R C */ + +/* the xdr functions */ + +#if defined(__STDC__) || defined(__cplusplus) +extern bool_t xdr_fhandle (XDR *, fhandle); +extern bool_t xdr_fhandle3 (XDR *, fhandle3*); +extern bool_t xdr_mountstat3 (XDR *, mountstat3*); +extern bool_t xdr_fhstatus (XDR *, fhstatus*); +extern bool_t xdr_mountres3_ok (XDR *, mountres3_ok*); +extern bool_t xdr_mountres3 (XDR *, mountres3*); +extern bool_t xdr_dirpath (XDR *, dirpath*); +extern bool_t xdr_name (XDR *, name*); +extern bool_t xdr_mountlist (XDR *, mountlist*); +extern bool_t xdr_mountbody (XDR *, mountbody*); +extern bool_t xdr_groups (XDR *, groups*); +extern bool_t xdr_groupnode (XDR *, groupnode*); +extern bool_t xdr_exports (XDR *, exports*); +extern bool_t xdr_exportnode (XDR *, exportnode*); +extern bool_t xdr_ppathcnf (XDR *, ppathcnf*); + +#else /* K&R C */ +extern bool_t xdr_fhandle (); +extern bool_t xdr_fhandle3 (); +extern bool_t xdr_mountstat3 (); +extern bool_t xdr_fhstatus (); +extern bool_t xdr_mountres3_ok (); +extern bool_t xdr_mountres3 (); +extern bool_t xdr_dirpath (); +extern bool_t xdr_name (); +extern bool_t xdr_mountlist (); +extern bool_t xdr_mountbody (); +extern bool_t xdr_groups (); +extern bool_t xdr_groupnode (); +extern bool_t xdr_exports (); +extern bool_t xdr_exportnode (); +extern bool_t xdr_ppathcnf (); + +#endif /* K&R C */ + +#ifdef __cplusplus +} +#endif + +#endif /* !_NFSMOUNT_H_RPCGEN */ diff -ruN util-linux-2.12r.orig/text-utils/more.c util-linux-2.12r/text-utils/more.c --- text-utils/more.c 2004-12-22 10:46:25.000000000 +0000 +++ text-utils/more.c 2006-03-21 08:31:01.338939000 +0000 @@ -26,7 +26,7 @@ ** on linux/axp. ** modified by Kars de Jong to use terminfo instead ** of termcap. - 1999-02-22 Arkadiusz Mi¶kiewicz + 1999-02-22 Arkadiusz Mikiewicz - added Native Language Support 1999-03-19 Arnaldo Carvalho de Melo - more nls translatable strings @@ -811,7 +811,7 @@ state_bak = state; mbc[mbc_pos++] = c; process_mbc: - mblength = mbrtowc (&wc, mbc, mbc_pos, &state); + mblength = mbrtowc (&wc, (char *) mbc, mbc_pos, &state); switch (mblength) { case (size_t)-2: /* Incomplete multibyte character. */ @@ -930,7 +930,7 @@ mbc[mbc_pos++] = c; state_bak = state; - mblength = mbrtowc (&wc, mbc, mbc_pos, &state); + mblength = mbrtowc (&wc, (char *) mbc, mbc_pos, &state); /* The value of mblength is always less than 2 here. */ switch (mblength) { @@ -1268,7 +1268,7 @@ search (NULL, f, nlines); /* Use previous r.e. */ } else { - ttyin (cmdbuf, sizeof(cmdbuf)-2, '/'); + ttyin ((unsigned char *) cmdbuf, sizeof(cmdbuf)-2, '/'); putcerr('\r'); search (cmdbuf, f, nlines); } @@ -1469,7 +1469,7 @@ if (lastp) putsout(shell_line); else { - ttyin (cmdbuf, sizeof(cmdbuf)-2, '!'); + ttyin ((unsigned char *) cmdbuf, sizeof(cmdbuf)-2, '!'); expanded = 0; rc = expand (&expanded, cmdbuf); if (expanded) { @@ -1862,7 +1862,7 @@ while (1) { state_bak = state; - mblength = mbrtowc (&wc, buf + pos, sp - buf, &state); + mblength = mbrtowc (&wc, (char *) buf + pos, sp - buf, &state); state = (mblength == (size_t)-2 || mblength == (size_t)-1) ? state_bak : state; diff -ruN util-linux-2.12r.orig/text-utils/pg.c util-linux-2.12r/text-utils/pg.c --- text-utils/pg.c 2002-11-25 00:43:32.000000000 +0000 +++ text-utils/pg.c 2006-03-21 09:17:17.920239000 +0000 @@ -888,16 +888,19 @@ makeprint(char *s, size_t l) { #ifdef ENABLE_WIDECHAR - if (MB_CUR_MAX > 1) - return makeprint_for_mb(s, l); + if (MB_CUR_MAX > 1) { + makeprint_for_mb(s, l); + } else { #endif - - while (l--) { - if (!isprint(cuc(*s)) && *s != '\n' && *s != '\r' - && *s != '\b' && *s != '\t') - *s = '?'; - s++; + while (l--) { + if (!isprint(cuc(*s)) && *s != '\n' && *s != '\r' + && *s != '\b' && *s != '\t') + *s = '?'; + s++; + } +#ifdef ENABLE_WIDECHAR } +#endif } /*