[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] pnet/support ansi.c,1.3,1.4
From: |
Rhys Weatherley <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] pnet/support ansi.c,1.3,1.4 |
Date: |
Tue, 18 Nov 2003 20:55:34 +0000 |
Update of /cvsroot/dotgnu-pnet/pnet/support
In directory subversions:/tmp/cvs-serv28440/support
Modified Files:
ansi.c
Log Message:
Change MB_CUR_MAX to MB_LEN_MAX because the former may not be constant
on some platforms (thanks to Miroslaw Dobrzanski-Neumann).
Index: ansi.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/support/ansi.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ansi.c 5 Aug 2003 03:55:04 -0000 1.3
--- ansi.c 18 Nov 2003 20:55:31 -0000 1.4
***************
*** 27,30 ****
--- 27,33 ----
#include <stdlib.h>
#endif
+ #if HAVE_LIMITS_H
+ #include <limits.h>
+ #endif
#ifdef __cplusplus
***************
*** 46,49 ****
--- 49,56 ----
#endif
+ #ifndef MB_LEN_MAX
+ #define MB_LEN_MAX 6
+ #endif
+
unsigned long ILAnsiGetByteCount(const unsigned short *chars,
unsigned long
count)
***************
*** 55,59 ****
/* Use the re-entrant function to perform the conversion */
mbstate_t state;
! char buf[MB_CUR_MAX+1];
size_t chlen;
unsigned short ch;
--- 62,66 ----
/* Use the re-entrant function to perform the conversion */
mbstate_t state;
! char buf[MB_LEN_MAX+1];
size_t chlen;
unsigned short ch;
***************
*** 83,87 ****
and just hope that the underlying libc takes care of the
thread-safety issues for us */
! char buf[MB_CUR_MAX];
int chlen;
unsigned long len = 0;
--- 90,94 ----
and just hope that the underlying libc takes care of the
thread-safety issues for us */
! char buf[MB_LEN_MAX+1];
int chlen;
unsigned long len = 0;
***************
*** 135,139 ****
/* Use the re-entrant function to perform the conversion */
mbstate_t state;
! char buf[MB_CUR_MAX+1];
size_t chlen;
unsigned short ch;
--- 142,146 ----
/* Use the re-entrant function to perform the conversion */
mbstate_t state;
! char buf[MB_LEN_MAX+1];
size_t chlen;
unsigned short ch;
***************
*** 176,180 ****
and just hope that the underlying libc takes care of the
thread-safety issues for us */
! char buf[MB_CUR_MAX];
int chlen;
unsigned long len = 0;
--- 183,187 ----
and just hope that the underlying libc takes care of the
thread-safety issues for us */
! char buf[MB_LEN_MAX+1];
int chlen;
unsigned long len = 0;
***************
*** 400,404 ****
return charCount;
#else
! return charCount * MB_CUR_MAX;
#endif
}
--- 407,411 ----
return charCount;
#else
! return charCount * MB_LEN_MAX;
#endif
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] pnet/support ansi.c,1.3,1.4,
Rhys Weatherley <address@hidden> <=
- Prev by Date:
[Dotgnu-pnet-commits] pnet ChangeLog,1.2779,1.2780
- Next by Date:
[Dotgnu-pnet-commits] pnet ChangeLog, 1.2780, 1.2781 configure.in, 1.156, 1.157
- Previous by thread:
[Dotgnu-pnet-commits] pnet ChangeLog,1.2779,1.2780
- Next by thread:
[Dotgnu-pnet-commits] pnet ChangeLog, 1.2780, 1.2781 configure.in, 1.156, 1.157
- Index(es):