search for: isprint

Displaying 20 results from an estimated 70 matches for "isprint".

Did you mean: sprint
2013 Apr 20
2
Metaflac hex dump UTF-8 and locale fix
Small change to metaflac hexdump function. Changed so utf-8 decoding is only used for filename printing and changed hex output printing to not rely only on isprint. That function seems to return true for tabulator control character under Windows when application isn't using C-locale. At least it did so for all locales I tried (Finnish, German, English US). -------------- next part -------------- diff --git a/src/metaflac/utils.c b/src/metaflac/utils.c i...
2009 Jan 22
1
[LLVMdev] Minor AsmPrinter bug fix
The Microsoft CRT's implementation of isprint() has an internal assert that the unsigned value passed in is in [0,256) but unprintable chars passed in are sign extended to values that falsely trigger this assert. --- c:\usr\src\llvm-svn\lib\CodeGen\AsmPrinter\AsmPrinter.cpp Tue Jan 20 10:30:42 2009 +++ c:\usr\src\llvm-integrate\lib\CodeGen\A...
2006 Apr 30
4
unable to compile
.... */ rtp = (riff_tag_t *)(((char *)rtp) + 4); } else if(!memcmp(rtp->tag, icon, sizeof(icon))) { handle_ani_icon(rtp, type, isswapped); rtp = NEXT_TAG(rtp); } else internal_error(__FILE__, __LINE__, "Unknown tag \"%c%c%c%c\" in RIFF file", isprint(rtp->tag[0]) ? rtp->tag[0] : '.', isprint(rtp->tag[1]) ? rtp->tag[1] : '.', isprint(rtp->tag[2]) ? rtp->tag[2] : '.', isprint(rtp->tag[3]) ? rtp->tag[3] : '.'); /* FIXME: This relies in sizeof(DWORD) == size...
2011 Sep 17
3
[PATCH 1/1] hivexml: Base64-encode non-printable data
.... */ +static char * +encoding_recommendation (const char *data) +{ + /* Note that this function assumes data is null-terminated. */ + //See if the data are printable + int is_printable = 0; + size_t i; + size_t data_len = strlen(data); + + for (i=0; i < data_len; i++) { + is_printable = isprint (data[i]); + if (!is_printable) { + fprintf (stderr, "encoding_recommendation: Non-printable character found at data index %zu (c=%i)\n", i, data[i]); + break; + } + } + + return is_printable ? "none" : "base64"; +} + +static int +safe_print_string_at...
2004 Oct 25
2
printing ISO/8859-1 characters
Hi, I ran into an odd problem with the print command for R-2.0 on a windows machine. The icelandic character thorn (??,??) which is included in in the Latin-1 character set [iso/8859-1 char# 222 (upper case) and #254 (lower case)] prints out incorrectly. Instead of getting the correct character I get the octal codes for upper and lower case thorn (\336 or \376). This only happens on a windows
2009 Sep 17
2
[PATCH] Fix verbose packet dumping functions.
...printf ("%02x ", (unsigned char) (*buf_rtn)[j]); + printf ("%02x ", (*(unsigned char **)buf_rtn)[j]); for (; j < i+16; ++j) printf (" "); printf ("|"); - for (j = i; j < MIN (i+16, g->nr); ++j) - if (isprint ((*buf_rtn)[j])) - printf ("%c", (*buf_rtn)[j]); + for (j = i; j < MIN (i+16, nr); ++j) + if (isprint ((*(char **)buf_rtn)[j])) + printf ("%c", (*(char **)buf_rtn)[j]); else printf ("."); for (; j < i+16; +...
2014 Sep 27
2
[PATCH 1/2] Implement realpath()
...o link.o rmdir.o unlink.o utimes.o lstat.o mkdir.o \ - readlink.o select.o symlink.o pipe.o \ + readlink.o realpath.o select.o symlink.o pipe.o \ ctype/isalnum.o ctype/isalpha.o ctype/isascii.o \ ctype/isblank.o ctype/iscntrl.o ctype/isdigit.o \ ctype/isgraph.o ctype/islower.o ctype/isprint.o \ --- /dev/null +++ b/usr/klibc/realpath.c @@ -0,0 +1,147 @@ +#include <errno.h> +#include <limits.h> +#include <stdlib.h> +#include <sys/stat.h> +#include <unistd.h> + +static char *__realpath(const char *name, char *resolved_name, int recurse) +{ + char link_target...
2004 Nov 23
4
patch for replacing non-printable chars in filenames
...,15 @@ buf[len] = 0; + if (code == FINFO) { + /* Replace non-printing chars in the string, most probably due to + * wierd filenames. Skip the first and last chars, they may be \n */ + int i; + for (i=1; i<len-1; i++) + if (!isprint(buf[i])) + buf[i] = '?'; + } + if (am_server && msg_fd_out >= 0) { /* Pass the message to our sibling. */ send_msg((enum msgcode)code, buf, len);
2013 Aug 16
7
[PATCH v2] xen/console: buffer and show origin of guest PV writes
..._t port, uint32_t bytes, uint32_t *val) { - struct vcpu *curr = current; - struct hvm_domain *hd = &curr->domain->arch.hvm_domain; + struct domain *cd = current->domain; char c = *val; BUG_ON(bytes != 1); @@ -495,17 +494,16 @@ static int hvm_print_line( if ( !isprint(c) && (c != ''\n'') && (c != ''\t'') ) return X86EMUL_OKAY; - spin_lock(&hd->pbuf_lock); - hd->pbuf[hd->pbuf_idx++] = c; - if ( (hd->pbuf_idx == (HVM_PBUF_SIZE - 2)) || (c == ''\n'') ) + spin_lock...
2009 Sep 24
1
enabling more syntax-checks
...lude <rpc/xdr.h> +#include "c-ctype.h" #include "ignore-value.h" #include "daemon.h" @@ -96,7 +96,7 @@ main_loop (int _sock) printf (" "); printf ("|"); for (j = i; j < MIN (i+16, len); ++j) - if (isprint (buf[j])) + if (c_isprint (buf[j])) printf ("%c", buf[j]); else printf ("."); diff --git a/examples/Makefile.am b/examples/Makefile.am index fb3d656..adbb934 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -7,7 +7,9 @...
2017 Mar 21
4
Clang -O0 performs optimizations that undermine dynamic bug-finding tools
...ce it is UB). However, note that that cases exist where no warning is printed. For example, consider the following program: #include <ctype.h> int main() { isalnum(1000000); isalpha(1000000); iscntrl(1000000); isdigit(1000000); isgraph(1000000); islower(1000000); isprint(1000000); ispunct(1000000); isspace(1000000); isupper(1000000); isxdigit(1000000); } The glibc (on my system) implements the macros by calling __ctype_b_loc() which returns a lookup array that can be indexed by values between -128 and 255. Thus, I expected that, when compiling with...
2013 Sep 09
0
[PATCH v3] xen/console: buffer and show origin of guest PV writes
..._t port, uint32_t bytes, uint32_t *val) { - struct vcpu *curr = current; - struct hvm_domain *hd = &curr->domain->arch.hvm_domain; + struct domain *cd = current->domain; char c = *val; BUG_ON(bytes != 1); @@ -495,17 +494,16 @@ static int hvm_print_line( if ( !isprint(c) && (c != ''\n'') && (c != ''\t'') ) return X86EMUL_OKAY; - spin_lock(&hd->pbuf_lock); - hd->pbuf[hd->pbuf_idx++] = c; - if ( (hd->pbuf_idx == (HVM_PBUF_SIZE - 2)) || (c == ''\n'') ) + spin_lock...
2012 Oct 03
1
[PATCH] pxedump.c32: Simple PXE cached packet dumping
...ex view */ + while (i < columns) { + printf("XX "); + ++i; + } + + /* Display the ASCII view */ + printf("| "); + p = q; + for (i = 0; i < columns && bytes; ++i) { + printf("%c", isprint(*p) && !isspace(*p) ? *p : ' '); + ++p; + --bytes; + } + + /* Pad the ASCII view */ + while (i < columns) { + printf(" "); + ++i; + } + printf(" |\n"); + } + } -- 1.7.11....
2012 Aug 02
0
[LLVMdev] Problem to generate an executable file of 403.gcc (SPEC2006)
...to `ISGRAPH' 403.gcc.linked.rbc:(.text+0x326b8): undefined reference to `ISXDIGIT' 403.gcc.linked.rbc:(.text+0x994c2): undefined reference to `IS_NVSPACE' 403.gcc.linked.rbc:(.text+0x9aad3): undefined reference to `ISIDNUM' 403.gcc.linked.rbc:(.text+0x9ec89): undefined reference to `ISPRINT' 403.gcc.linked.rbc:(.text+0xcd96b): undefined reference to `ISALPHA' 403.gcc.linked.rbc:(.text+0x29c47d): undefined reference to `TOLOWER' etc, etc, etc. I am running LLVM 3.0 on a Linux Ubuntu on a 32-bits x86 machine. I need a little help with this. Regards, Raphael
2017 Oct 11
0
[PATCH miniexpect 1/2] When debugging, escape the buffer output.
...msg); + fprintf (stderr, "\n"); #endif n = len; @@ -430,3 +439,31 @@ mexp_send_interrupt (mexp_h *h) { return write (h->fd, "\003", 1); } + +#if DEBUG +/* Print escaped buffer to fp. */ +static void +debug_buffer (FILE *fp, char *buf) +{ + while (*buf) { + if (isprint (*buf)) + fputc (*buf, fp); + else { + switch (*buf) { + case '\0': fputs ("\\0", fp); break; + case '\a': fputs ("\\a", fp); break; + case '\b': fputs ("\\b", fp); break; + case '\f': fputs ("\\f&qu...
2001 Oct 04
1
Bug when trying to save a character vector with an embedded / (PR#1115)
Here is an example involving "VIA\B". > version _ platform sparc-sun-solaris2.6 arch sparc os solaris2.6 system sparc, solaris2.6 status major 1 minor 3.0 year 2001 month 06 day 22 language
2004 Dec 21
1
R-2.0.2 soon?
Hi, There has been a continuous stream of development updates since R-2.0.1 and I'm wondering if it is anticipated that these will crystallise soon into R-2.0.2? Or is it likely that we must wait rather longer? With thanks, Ted. -------------------------------------------------------------------- E-Mail: (Ted Harding) <Ted.Harding@nessie.mcc.ac.uk> Fax-to-email: +44 (0)870 094 0861
2003 Nov 24
1
[PATCH] fix off-by-one correction in ctypes
...int __c) { - return __ctypes[__c+1] & + return __ctypes[__c] & (__ctype_upper|__ctype_lower|__ctype_digit|__ctype_punct); } __ctype_inline int islower(int __c) { - return __ctypes[__c+1] & __ctype_lower; + return __ctypes[__c] & __ctype_lower; } __ctype_inline int isprint(int __c) { - return __ctypes[__c+1] & __ctype_print; + return __ctypes[__c] & __ctype_print; } __ctype_inline int ispunct(int __c) { - return __ctypes[__c+1] & __ctype_punct; + return __ctypes[__c] & __ctype_punct; } __ctype_inline int isspace(int __c) { - return __c...
2005 Jun 05
0
fancy dump_fs for nfsmount
...; + for (i = done; i < done + 16; i++) { + if (i < len) + printf ("%02x ", buf[i] & 0xff); + else + printf (" "); + if (i % 4 == 3) printf (" "); + } + for (i = done; i < done + 16; i++) { + if (i < len) + printf ("%c", isprint(buf[i]) ? buf[i] : '.'); + if (i % 4 == 3) printf (" "); + } + printf ("\n"); + done += 16; + } +} +#endif NFS_DEBUG + + static inline void dump_params(__u32 server, const char *path, const struct nfs_mount_data *data) @@ -122,23 +149,7 @@ st...
2014 Sep 29
0
[PATCH v2 1/2] Implement realpath()
...o link.o rmdir.o unlink.o utimes.o lstat.o mkdir.o \ - readlink.o select.o symlink.o pipe.o \ + readlink.o realpath.o select.o symlink.o pipe.o \ ctype/isalnum.o ctype/isalpha.o ctype/isascii.o \ ctype/isblank.o ctype/iscntrl.o ctype/isdigit.o \ ctype/isgraph.o ctype/islower.o ctype/isprint.o \ --- /dev/null +++ b/usr/klibc/realpath.c @@ -0,0 +1,45 @@ +#include <fcntl.h> +#include <limits.h> +#include <stdlib.h> +#include <sys/types.h> +#include <unistd.h> + +/* + * Note that this requires name to refer to an existing file. This is + * correct according...