initialized ret and checked tempSensor before using, commented out str printf

pull/34/head
alanbjohnston 6 years ago committed by GitHub
parent 8508f477e2
commit 2999b9ade2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -124,6 +124,8 @@ int main(void) {
} else
{
tempSensor = wiringPiI2CSetupInterface("/dev/i2c-3", 0x48);
if (wiringPiI2CReadReg16(tempSensor, 0) < 0)
tempSensor = -1;
}
// fprintf(stderr,"tempSensor: %d \n",tempSensor);
@ -239,7 +241,7 @@ int main(void) {
{
char cmdbuffer[1000];
strcat(str,footer_str);
fprintf("String to execute: %s\n", str);
// fprintf("String to execute: %s\n", str);
FILE* file2 = popen(str, "r");
fgets(cmdbuffer, 999, file2);
pclose(file2);

Loading…
Cancel
Save

Powered by TurnKey Linux.