Mercurial > vim
comparison src/os_mswin.c @ 10355:9f88dba65a2d v8.0.0072
commit https://github.com/vim/vim/commit/38bc49563782ee1cb91660e58acf1afe1a31020a
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Nov 10 17:10:51 2016 +0100
patch 8.0.0072
Problem: MS-Windows: Crash with long font name. (Henry Hu)
Solution: Fix comparing with LF_FACESIZE. (Ken Takata, closes https://github.com/vim/vim/issues/1243)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 10 Nov 2016 17:15:04 +0100 |
parents | c036c0f636d5 |
children | f54e4c691de4 |
comparison
equal
deleted
inserted
replaced
10354:1406a8ee653a | 10355:9f88dba65a2d |
---|---|
2891 /* | 2891 /* |
2892 * Split name up, it could be <name>:h<height>:w<width> etc. | 2892 * Split name up, it could be <name>:h<height>:w<width> etc. |
2893 */ | 2893 */ |
2894 for (p = name; *p && *p != ':'; p++) | 2894 for (p = name; *p && *p != ':'; p++) |
2895 { | 2895 { |
2896 if (p - name + 1 > LF_FACESIZE) | 2896 if (p - name + 1 >= LF_FACESIZE) |
2897 goto theend; /* Name too long */ | 2897 goto theend; /* Name too long */ |
2898 lf->lfFaceName[p - name] = *p; | 2898 lf->lfFaceName[p - name] = *p; |
2899 } | 2899 } |
2900 if (p != name) | 2900 if (p != name) |
2901 lf->lfFaceName[p - name] = NUL; | 2901 lf->lfFaceName[p - name] = NUL; |