I would rename "num" to smth. like "absolute_value"
RAW_CHECK(pos > 0);
Oh, this is ugly. Can you write
char c = (pad_with_zero || pos == 0) ? '0' : ' '); result += AppendChar(buff, buff_end, c); pos--;
Does negation works properly for INT_MIN here?
And now the function name doesn't make any sense. Please either rename it, or use different helper in Padding test.
Add tests for both 2-digit and 4-digit numbers with %3d / %03d.