msdosfs_conv.c (172027) | msdosfs_conv.c (187199) |
---|---|
1/* $FreeBSD: head/sys/fs/msdosfs/msdosfs_conv.c 172027 2007-08-31 22:29:55Z bde $ */ | 1/* $FreeBSD: head/sys/fs/msdosfs/msdosfs_conv.c 187199 2009-01-13 22:35:26Z trasz $ */ |
2/* $NetBSD: msdosfs_conv.c,v 1.25 1997/11/17 15:36:40 ws Exp $ */ 3 4/*- 5 * Copyright (C) 1995, 1997 Wolfgang Solfrank. 6 * Copyright (C) 1995, 1997 TooLs GmbH. 7 * All rights reserved. 8 * Original code by Paul Popelka (paulp@uts.amdahl.com) (see below). 9 * --- 1045 unchanged lines hidden (view full) --- 1055 * WIN_CHARS bytes when they are first encountered. 1056 */ 1057void 1058mbnambuf_write(struct mbnambuf *nbp, char *name, int id) 1059{ 1060 char *slot; 1061 size_t count, newlen; 1062 | 2/* $NetBSD: msdosfs_conv.c,v 1.25 1997/11/17 15:36:40 ws Exp $ */ 3 4/*- 5 * Copyright (C) 1995, 1997 Wolfgang Solfrank. 6 * Copyright (C) 1995, 1997 TooLs GmbH. 7 * All rights reserved. 8 * Original code by Paul Popelka (paulp@uts.amdahl.com) (see below). 9 * --- 1045 unchanged lines hidden (view full) --- 1055 * WIN_CHARS bytes when they are first encountered. 1056 */ 1057void 1058mbnambuf_write(struct mbnambuf *nbp, char *name, int id) 1059{ 1060 char *slot; 1061 size_t count, newlen; 1062 |
1063 KASSERT(nbp->nb_len == 0 || id == nbp->nb_last_id - 1, 1064 ("non-decreasing id: id %d, last id %d", id, nbp->nb_last_id)); | 1063 if (nbp->nb_len != 0 && id != nbp->nb_last_id - 1) { 1064 printf("msdosfs: non-decreasing id: id %d, last id %d\n", 1065 id, nbp->nb_last_id); 1066 return; 1067 } |
1065 1066 /* Will store this substring in a WIN_CHARS-aligned slot. */ 1067 slot = &nbp->nb_buf[id * WIN_CHARS]; 1068 count = strlen(name); 1069 newlen = nbp->nb_len + count; 1070 if (newlen > WIN_MAXLEN || newlen > MAXNAMLEN) { 1071 printf("msdosfs: file name length %zu too large\n", newlen); 1072 return; --- 34 unchanged lines hidden --- | 1068 1069 /* Will store this substring in a WIN_CHARS-aligned slot. */ 1070 slot = &nbp->nb_buf[id * WIN_CHARS]; 1071 count = strlen(name); 1072 newlen = nbp->nb_len + count; 1073 if (newlen > WIN_MAXLEN || newlen > MAXNAMLEN) { 1074 printf("msdosfs: file name length %zu too large\n", newlen); 1075 return; --- 34 unchanged lines hidden --- |