Jun 11, 2015 03:57 AM
(This post was last modified: Jun 11, 2015 04:20 AM by splutter.)
So I have a piece of code and I'm attempting to scan in a string with a call to fgets. It's not reading anything in and the return value is NULL. May someone tell me how I could check my error value or teach me how I should approach this?
My code goes something like this:
My code goes something like this:
Code
...
push DWORD 0x0 ; STDIN is 0
push BYTE 0xA ; Max size is 10
push DWORD buf ; load address of buffer for input
call _fgets
add esp 0xC ; reset stack pointer
cmp eax, 0x0 ; check return value in eax
jz err ; jump to error address if NULL
...
