Adam Rosenfield

United States

adamrosenfield.com

Age: 27

Software engineer from Cambridge, MA

Apr
10
awarded Autobiographer
Apr
10
comment Heartbleed: OpenSSL v 0.9.8o and OpenVPN v 2.1.3 Reporting Vulnerable
Also try: sudo cat /proc/<serverpid>/maps and look at the path to the version of libcrypto.so being linked in dynamically by the server process.
Apr
9
comment obj-c linear interpolation between two numbers
@PsychoDad: Yes
Apr
7
comment Cant access constant POLLIN from select module with python 2.7 or 3.3 on windows
Windows doesn't support the poll() system call, so this is never going to work unless you rewrite your code to use a different I/O primitive instead such as select().
Apr
7
awarded Guru
Apr
6
awarded Nice Answer
Apr
4
awarded Good Answer
Apr
3
revised Mixing C and C++ libraries
added 16 characters in body
Mar
28
awarded Popular Question
Mar
27
awarded Revival
Mar
25
answered What is the opposite of calloc in C
Mar
25
comment Platform independent size_t Format specifiers in c?
@detly: No, the z length modifier is not part of C89/C90. If you're aiming for C89-compliant code, the best you can do is cast to unsigned long and use the l length modifier instead, e.g. printf("the size is %lu\n", (unsigned long)size);; supporting both C89 and systems with size_t larger than long is trickier and would require using a number of preprocessor macros.
Mar
20
comment fputc vs putc in C Implementation
@JimBalter: §7.1.3/1 says "Each header declares or defines all identifiers listed in its associated subclause" and "All identifiers with external linkage in any of the following subclauses (including the future library directions) are always reserved for use as identifiers with external linkage.", and §7.19.7.8/1 gives a prototype for putc() with (implicit) external linkage. Therefore, there must be a function with external linkage named putc().
Mar
20
comment Downloading images using socket programming in C
You need to open the output file in binary mode (e.g. fopen(..., "w+b")), otherwise you're going to corrupt the binary data on Windows.
Mar
20
comment How to catch exception without throw
On Windows, if you pass the /EHa option to the compiler, you can catch access violations (and other Windows SEH exceptions) as C++ exceptions. But this is rarely a good idea.
Mar
17
comment fputc vs putc in C Implementation
@JimBalter: No, your claim is baseless and erroneous—there is such a requirement. C99 §7.1.4/1 says "Any function declared in a header may be additionally implemented as a function-like macro defined in the header [...]", and §7.19.7.8/2 says "The putc function is equivalent to fputc, except that if it is implemented as a macro, it may evaluate stream more than once, so that argument should never be an expression with side effects." It's guaranteed to be a function, but it may also be a macro.
Mar
17
awarded Announcer
Mar
15
comment Is char signed or unsigned on OS X C++
Why do you need to know this? If you need a signed char, use signed char, and if you need an unsigned char, use unsigned char.
Mar
14
awarded Nice Question
Mar
7
comment If statement not evaluating as expected
You never set x[i] back to 0 anywhere. Once it gets set to 1 once, it stays as 1.
1 2 3 4 5