int received_data[0]
Yes. I suspect this is the problem. It's one of the GOTCHAs in C that you define arrays with the actual number of elements but you address them with the first element as [ 0]. So that line should be int received_data[1]
The likely affect of your error is that when you reference received_data[0] later in the program it is actually using the data that is in the next address location (whatever that may be). If you want to explore the phenomenon add another variable (say char testChar = 'a'; ) immediately after the array definition and see what happens when you try to print testChar.
Of course, as @jremington has said, it doesn't make a lot of sense to create an array with a single element.
...R