core: Really remove CR from version output.
authorWerner Koch <wk@gnupg.org>
Tue, 16 Oct 2018 15:05:14 +0000 (17:05 +0200)
committerWerner Koch <wk@gnupg.org>
Tue, 16 Oct 2018 15:05:14 +0000 (17:05 +0200)
* src/version.c (_gpgme_get_program_version): Fix test.
--

Fixes-commit: 6bde056355796f15b6e6954372e87f349847515b
Signed-off-by: Werner Koch <wk@gnupg.org>
src/version.c

index 99698fa..bd1d965 100644 (file)
@@ -338,7 +338,7 @@ _gpgme_get_program_version (const char *const file_name)
          mark = strchr (&line[linelen], '\n');
          if (mark)
            {
-             if (mark > &line[0] && *mark == '\r')
+             if (mark > &line[0] && mark[-1] == '\r')
                mark--;
              *mark = '\0';
              break;