]> gitweb @ CieloNegro.org - build-hc-pkg.git/blobdiff - canon-name/src/canon-name.c
Use autotools' idea of the canonical name of platform as-is.
[build-hc-pkg.git] / canon-name / src / canon-name.c
index 447083f35edcdabe31c22f231d65e9056835a77f..b74f50bd2e14835a27e1bb2f7e21883e35008764 100644 (file)
@@ -1,8 +1,15 @@
 #include "config.h"
 #include <stdio.h>
-#include <string.h>
 
 int main(int argc, char* argv[]) {
-    size_t n_non_digits = strcspn(HOST_OS, "0123456789");
-    printf("%s-%s-%.*s\n", HOST_CPU, HOST_VENDOR, n_non_digits, HOST_OS);
+    int ret;
+
+    ret = printf("%s-%s-%s\n", HOST_CPU, HOST_VENDOR, HOST_OS);
+    if (ret < 0) {
+        perror(NULL);
+        return 1;
+    }
+    else {
+        return 0;
+    }
 }