search for: fputc

Displaying 20 results from an estimated 127 matches for "fputc".

Did you mean: fputs
2018 Mar 08
2
[Bug report] Chinese characters are not handled correctly in Rterm for Windows
...CC6E0)?? However, if the text is pasted into the console, it will not crash. ---ADDITIONAL INFO--- Both 32-bit and 64-bit versions have the same problem. I attached a debugger to observe Rterm's behavior. The command in step 4 produced the following calling sequence of C library function "fputc": fputc ( 91, 0x00007ffe2d1aea40 ) //'[' fputc ( 49, 0x00007ffe2d1aea40 ) //'1' fputc ( 93, 0x00007ffe2d1aea40 ) //']' //fflush ( 0x00007ffe2d1aea40 ) fputc ( 32, 0x00007ffe2d1aea40 ) //' ' fputc ( 34, 0x00007ffe2d1aea40 ) //'\"' fputc ( 65, 0x0000...
2018 Apr 05
0
[Bug report] Chinese characters are not handled correctly in Rterm for Windows
...n e.g. here https://msdn.microsoft.com/en-us/library/cc194923.aspx https://msdn.microsoft.com/en-us/library/cc194920.aspx What is the output of "chcp" in the terminal, before you run R.exe? It may be different from what Sys.getlocale() gives in R. If you take the sequence of the "fputc" commands you captured by the debugger, and create a trivial console application to just run them - would the characters display correctly in the same terminal from which you run R.exe? Thanks Tomas On 03/08/2018 06:54 PM, Azure wrote: > Hello everyone, > > > I am new to R an...
2023 Feb 20
1
fseek/fgetc puzzle
...gt; I would create the initial file separately from the test program. > > The "od" call in the middle of the above example proves there's only > one byte after the first fclose. Ah, so it does. What happens if you do everything except the last call at the end? printf("fputc B = %d\n", fputc('B', f)); What happens if you don't read the last byte? I realize you will need to for the original problem? What I'm wondering is if somehow reading the byte puts it in the output buffer. What happens if you create an initial two byte file, say "AB&qu...
2020 Jul 25
0
[klibc:master] stdio: Define all the _unlocked functions and macros
...ompleteness, also define corresponding _unlocked macros for the macro-only pseudo-functions, and for the inline functions in stdio.h. Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/include/stdio.h | 20 ++++++++++++++++++++ usr/klibc/fgets.c | 1 + usr/klibc/fputc.c | 1 + usr/klibc/fputs.c | 1 + usr/klibc/fread2.c | 1 + usr/klibc/fwrite2.c | 2 ++ usr/klibc/stdio/clearerr.c | 1 + usr/klibc/stdio/feof.c | 1 + usr/klibc/stdio/ferror.c | 1 + usr/klibc/stdio/fflush.c | 2 +- usr/klibc/stdio/fgetc.c | 1 +...
2018 Apr 28
2
[Bug report] Chinese characters are not handled correctly in Rterm for Windows
...;) ? Yes. The console output is pasted in [ https://paste.ubuntu.com/p/TYgZWhdgXK/ ] (to avoid gibberish in e-mail). The Active Code Page is 936 before and after running Rterm. >As a sanity check - does this display the correct characters in RGui? Yes. >If you take the sequence of the "fputc" commands you captured by the debugger, and create a trivial console application to just run them - would the characters display correctly in the same terminal from which you run R.exe? Yes. I created an Win32 Console Application in VS [ https://paste.ubuntu.com/p/h3NFV6nQvs/ ], and all the ch...
2010 Aug 04
1
[PATCH] Send trace output to stderr
..." n n; + pr " else fprintf (stderr, \" null\");\n" | StringList n | DeviceList n -> (* string list *) - pr " putchar (' ');\n"; - pr " putchar ('\"');\n"; + pr " fputc (' ', stderr);\n"; + pr " fputc ('\"', stderr);\n"; pr " for (i = 0; %s[i]; ++i) {\n" n; - pr " if (i > 0) putchar (' ');\n"; - pr " fputs (%s[i], stdout);\n" n; +...
2019 Feb 19
0
[PATCH nbdkit 3/4] common: Move a utility function to a common directory.
...pqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_=,:/"; + size_t i, len; + + /* If the string consists only of safe characters, output it as-is. */ + len = strlen (str); + if (len == strspn (str, safe_chars)) { + fputs (str, fp); + return; + } + + /* Double-quote the string. */ + fputc ('"', fp); + for (i = 0; i < len; ++i) { + switch (str[i]) { + case '$': case '`': case '\\': case '"': + fputc ('\\', fp); + /*FALLTHROUGH*/ + default: + fputc (str[i], fp); + } + } + fputc ('"'...
2018 May 04
0
[Bug report] Chinese characters are not handled correctly in Rterm for Windows
...Tomas ??? #include <stdio.h> ??? #include <locale.h> ??? int main(int argc, char **argv) { ??????? //if (!setlocale(LC_CTYPE, "Chinese")) fprintf(stderr, "setlocale failed\n"); ??????? int chars[] = { 67, 196, 227, 68 }; ??????? for(int i = 0; i < 4; i++) fputc(chars[i], stdout); ??????? fprintf(stdout, "\n"); ??????? return 0; ??? } On 04/28/2018 04:53 PM, Azure wrote: > Hi Tomas, > > Sorry for the delayed response. I have tested the problem on the latest R-devel build (2018-04-27 r74651), and it still exists. RGui is always fine w...
2023 Feb 17
2
fseek/fgetc puzzle
...fclose(f); f = fopen("testfile", "a+"); /* same behaviour for r+ */ fseek(f, -1L, SEEK_END); printf("c=%d\n", fgetc(f)); /* fseek(f, 0, SEEK_END); -- with this it behaves as expected */ /* fflush(f); -- this too */ fputc('B', f); } $ gcc test.c && ./a.out; od -x -c testfile c=65 0000000 4141 0042 A A B 0000003 I wrote two bytes and read one but somehow ended up with three bytes in the file? (This example is from Solaris 11 but AIX does the same thing). On most platforms this...
2015 Feb 24
4
Call for testing: OpenSSH 6.8
......) __attribute__((format(printf, 2, 3))); +static void warn(const char *, ...) __attribute__((format(printf, 1, 2))); + +static void +err(int r, const char *fmt, ...) +{ + va_list args; + + va_start(args, fmt); + fprintf(stderr, "%s: ", strerror(errno)); + vfprintf(stderr, fmt, args); + fputc('\n', stderr); + va_end(args); + exit(r); +} + +static void +errx(int r, const char *fmt, ...) +{ + va_list args; + + va_start(args, fmt); + vfprintf(stderr, fmt, args); + fputc('\n', stderr); + va_end(args); + exit(r); +} + +static void +warn(const char *fmt, ...) +{ + va_list args...
2020 Oct 06
2
[PATCH libnbd] info: Write output atomically.
...for (struct context_list *next = contexts; next; next = next->next) { - printf ("\t\t"); + fprintf (fp, "\t\t"); print_json_string (next->name); if (next->next) - putchar(','); - putchar('\n'); + fputc (',', fp); + fputc ('\n', fp); } - printf ("\t],\n"); + fprintf (fp, "\t],\n"); } if (is_rotational >= 0) - printf ("\t\"%s\": %s,\n", + fprintf (fp, "\t\"%s\": %s,\n",...
2005 Apr 28
0
[LLVMdev] SimplifyLibCalls Pass -- Help!
...* floor(cnst) -> cnst' fprintf: * fprintf(file,fmt) -> fputs(fmt,file) (if fmt is constant and constains no % characters) * fprintf(file,"%s",str) -> fputs(orig,str) (only if the fprintf result is not used) * fprintf(file,"%c",chr) -> fputc(chr,file) fputs: (only if the result is not used) * fputs("",F) -> noop * fputs(s,F) -> fputc(s[0],F) (if s is constant and strlen(s) == 1) * fputs(s,F) -> fwrite(s, 1, len, F) (if s is constant and strlen(s) > 1) isascii: * isascii(c) -> ((c &am...
2017 Feb 04
4
[PATCH 0/4] p2v: Send ping packets, document timeout problems.
Fix and/or document issues raised in this thread: https://www.redhat.com/archives/libguestfs/2017-February/msg00010.html Rich.
2015 Feb 24
2
Call for testing: OpenSSH 6.8
On Mon, Feb 23, 2015 at 04:17:37PM -0800, Kevin Brott wrote: > Hrm - must have been a timing issue or my user error. In any case, just > pulled the latest commits ... > > *AIX 6.1/7.1 now fails here:* > *...* > xlc_r -O2 -qarch=ppc -qalloca -I/usr/include > -I/opt/freeware/include -I. -I. -O2 -qarch=ppc -qalloca -I/usr/include > -I/opt/freeware/include
2018 May 09
0
"Replace locked IO with unlocked IO" optimizations
It's probably worth going into a little more detail... a lot of people read llvmdev, and most of them won't click the link or follow the whole discussion. The transform in question is replacing "fputc(...)" with "fputc_unlocked(...)" when we can prove the FILE* doesn't escape. The question is whether it's safe for the compiler to emit a call to fputc_unlocked() on Linux, given it's a non-standard extension.  The bit I'm most worried about is some user defining...
2018 May 08
2
"Replace locked IO with unlocked IO" optimizations
Hello, Please check this patch: https://reviews.llvm.org/D45736 as Eli noted, other opinions are highly welcomed.. Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180509/c2eb9888/attachment.html>
2020 Oct 04
2
UpdateHostkeys now enabled by default
On Sun, Oct 04, 2020 at 09:24:12PM +1100, Damien Miller wrote: > On Sun, 4 Oct 2020, Damien Miller wrote: > > > No - I think you've stumbled on a corner case I hadn't anticipated. > > Does your configuration override CheckHostIP at all? No. > > > > What are the known_hosts entries for the hostname and IP? > > Also, do you use HashKnownHosts? or do
2018 May 09
1
"Replace locked IO with unlocked IO" optimizations
On 05/08/2018 07:13 PM, Friedman, Eli via llvm-dev wrote: > It's probably worth going into a little more detail... a lot of people > read llvmdev, and most of them won't click the link or follow the > whole discussion. > > The transform in question is replacing "fputc(...)" with > "fputc_unlocked(...)" when we can prove the FILE* doesn't escape.  The > question is whether it's safe for the compiler to emit a call to > fputc_unlocked() on Linux, given it's a non-standard extension.  The > bit I'm most worried about is so...
2004 Sep 24
0
[LLVMdev] Little win32/Signals.cpp patch
...und, even with argument-dependent lookup d:\home\arathorn\sandbox\llvm\llvm\lib\System\platform\Signals.cpp(187) : error C3861: 'stderr': identifier not found, even with argument-dependent lookup d:\home\arathorn\sandbox\llvm\llvm\lib\System\platform\Signals.cpp(200) : error C3861: 'fputc': identifier not found, even with argument-dependent lookup d:\home\arathorn\sandbox\llvm\llvm\lib\System\platform\Signals.cpp(200) : error C3861: 'stderr': identifier not found, even with argument-dependent lookup d:\home\arathorn\sandbox\llvm\llvm\lib\System\platform\Signals.cpp(20...
2017 Apr 27
4
[PATCH 0/4] common: Add a simple mini-library for handling qemu command and config files.
Currently we have an OCaml library for generating the qemu command line (used only by ‘virt-v2v -o qemu’). However we also generate a qemu command line in ‘lib/launch-direct.c’, and we might in future need to generate a ‘-readconfig’-compatible configuration file if we want to go beyond 10,000 drives for scalability testing. Therefore this patch series reimplements the qemu command line code as