File: exit_on_unpack_failure

package info (click to toggle)
garmin-forerunner-tools 0.10repacked-16
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,524 kB
  • sloc: sh: 9,153; ansic: 8,577; perl: 229; makefile: 66; python: 37; xml: 23
file content (26 lines) | stat: -rw-r--r-- 953 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Author: Ralf Treinen <treinen@debian.org>
Description: garmin_unpack_chunk exits when unexpected data is found.
Debian-bug: #715938, #715939, #715940, #715941

Index: garmin-forerunner-tools/src/unpack.c
===================================================================
--- garmin-forerunner-tools.orig/src/unpack.c	2013-07-11 21:52:51.000000000 +0200
+++ garmin-forerunner-tools/src/unpack.c	2013-07-11 21:55:18.000000000 +0200
@@ -1139,13 +1139,15 @@
 
     if ( unpacked != chunk ) {      
       /* unpacked the wrong number of bytes! */
-      printf("garmin_unpack_chunk: unpacked %d bytes (expecting %d)\n",
+      printf("garmin_unpack_chunk: unpacked %d bytes (expecting %d). Exiting.\n",
 	     unpacked,chunk);
+      exit(1);
     }
     
   } else {
     /* unknown file format */
-    printf("garmin_unpack_chunk: not a .gmn file\n");
+    printf("garmin_unpack_chunk: not a .gmn file. Exiting.\n");
+    exit(1);
   }
 
   return data;