Converting a region code (short string up to 4 characters) to a 32-bit integer
Even if the char array is not aligned, your *((uint32_t *)buf) will be correct: the compiler will ensure the necessary operations are performed.

Note that I used unit32_t: the C standard does not guarantee the size of an int.

One thing: since these are 4 byte integers, you can use an endianness-independent way of doing things by using htonl()/ntohl().