nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH V3] input: allow distinguishing shifted from unshifted Meta k


From: Brand Huntsman
Subject: Re: [PATCH V3] input: allow distinguishing shifted from unshifted Meta keystrokes
Date: Fri, 13 Dec 2019 19:29:17 -0700

On Thu, 12 Dec 2019 15:16:39 -0700
Brand Huntsman <address@hidden> wrote:

> nano.c: In function 'main':
> nano.c:2397:22: error: assignment of read-only location
> '*(chord->keystr + 2)' 2397 |     chord->keystr[2] =
> tolower(chord->keystr[2]);
> 
> typedef struct keystruct {
>     const char *keystr;

Replying to this because the V4 patch email vanished.

You can't just cast the const away and hope it works, it doesn't. The const is 
there because keystr can hold string literals, and literals are stored in a 
readonly segment on systems with the slightest bit of security. Did it actually 
work on yours?

The tolower() needs to allocate and copy keystr before modifying it.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]