C gets_s() implementation
First, don't call it gets_s as the signature and behavior differs in some subtle and not-so-subtle ways, that just leads to confusion and frustration. Anyway, you really wouldn't want the gets_s-contract.
Call it something descriptive like getline_truncated.

Do you know that n &lt;= 0 is UB in your implementation?

if (temp == EOF || temp = '\n')
                        ^


I'm sure your compiler warns you about the typo above.
Or don't you ask it for all warnings (-Wall -Wextra -std=...)?

I suggest re-defining and re-naming your return-codes to allow better result-testing:

#define GETS_S_TRUNCATED 1
// Because truncation is not neccessarily an error
#define GETS_S_OK 0
#define GETS_S_ERROR EOF
// Because we already have an appropriate negative constant


This way you can test for ==0 or &gt;=0 depending on what you decide is "success", respectively !=0 or &lt;0 for "failure".