Switch alltypes.proto to use the new .options file mechanism.
[apps/agl-service-can-low-level.git] / tests / test_decode1.c
index 78781dd..56bbd8f 100644 (file)
@@ -63,13 +63,19 @@ int main()
     uint8_t buffer[512];
     size_t count = fread(buffer, 1, sizeof(buffer), stdin);
     
+    if (!feof(stdin))
+    {
+       printf("Message does not fit in buffer\n");
+       return 1;
+    }
+    
     /* Construct a pb_istream_t for reading from the buffer */
     pb_istream_t stream = pb_istream_from_buffer(buffer, count);
     
     /* Decode and print out the stuff */
     if (!print_person(&stream))
     {
-        printf("Parsing failed.\n");
+        printf("Parsing failed: %s\n", PB_GET_ERROR(&stream));
         return 1;
     } else {
         return 0;