summaryrefslogtreecommitdiff
path: root/temperature.c
diff options
context:
space:
mode:
Diffstat (limited to 'temperature.c')
-rw-r--r--temperature.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/temperature.c b/temperature.c
new file mode 100644
index 0000000..91b871b
--- /dev/null
+++ b/temperature.c
@@ -0,0 +1,12 @@
+#include <stdio.h>
+
+#include "util.h"
+
+const char *
+temp(const char *file)
+{
+ int temp;
+
+ return (pscanf(file, "%d", &temp) == 1) ?
+ bprintf("%d", temp / 1000) : NULL;
+}