For the DS18S20 just read the temperature, divide by 2, and that will be the
temp in deg C for positive temps.

For negative temp in deg C, complement the value read, divide by 2, then
add 1. That's all you need to do for a DS18S20 deg C conversion.

The code you're trying to use is for a DS18B20 which is 12-bit. The DS18S20
isn't 12-bit. Compare both datasheets for an explanation.