Browse Source

blob: add support for u64

Steven Barth 10 years ago
parent
commit
393bc2b908
1 changed files with 8 additions and 0 deletions
  1. 8 0
      blob.c

+ 8 - 0
blob.c

@@ -25,6 +25,7 @@ uci_attr_to_blob(struct blob_buf *b, const char *str,
 {
 	char *err;
 	int intval;
+	long long llval;
 
 	switch (type) {
 	case BLOBMSG_TYPE_STRING:
@@ -47,6 +48,13 @@ uci_attr_to_blob(struct blob_buf *b, const char *str,
 
 		blobmsg_add_u32(b, name, intval);
 		break;
+	case BLOBMSG_TYPE_INT64:
+		llval = strtoll(str, &err, 0);
+		if (*err)
+			return false;
+
+		blobmsg_add_u64(b, name, llval);
+		break;
 	default:
 		return false;
 	}