Still one thing. I would initialise prime_count to 0, because of (prime_count++ < prime_amount).

Assume prime_amount is N. Then you run from 0 to N-1. Which is in fact N prime numbers. You are initialising prime_count as 1, so you are running from 1 to N-1, which results in N-1 primenumbers, but you want N prime numbers.

Or do (prime_count++ <= prime_amount). This would lead to running from 1 to N.