]> git.sur5r.net Git - openocd/commitdiff
svf: fix off-by-one error in line numbers as output to user
authorPaul Fertser <fercerpav@gmail.com>
Thu, 27 Aug 2015 11:09:28 +0000 (14:09 +0300)
committerFreddie Chopin <freddie.chopin@gmail.com>
Fri, 20 Nov 2015 22:26:21 +0000 (22:26 +0000)
This makes SVF error output match actual line numbers in the file
processed.

Change-Id: I1fa4b9d0891e4358b7beada516945d5331ebe182
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2945
Tested-by: jenkins
src/svf/svf.c

index a90ccd1543184475f5d52ee697beb0e020ac2672..73c75eed1dc7853cf9f91edf5bdc778a2d227070 100644 (file)
@@ -223,7 +223,7 @@ static char *svf_read_line;
 static size_t svf_read_line_size;
 static char *svf_command_buffer;
 static size_t svf_command_buffer_size;
-static int svf_line_number = 1;
+static int svf_line_number;
 static int svf_getline(char **lineptr, size_t *n, FILE *stream);
 
 #define SVF_MAX_BUFFER_SIZE_TO_COMMIT   (1024 * 1024)
@@ -417,7 +417,7 @@ COMMAND_HANDLER(handle_svf_command)
        time_measure_ms = timeval_ms();
 
        /* init */
-       svf_line_number = 1;
+       svf_line_number = 0;
        svf_command_buffer_size = 0;
 
        svf_check_tdo_para_index = 0;