emacs-devel
[Top][All Lists]
Advanced

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

Re: About the new frame title


From: Angelo Graziosi
Subject: Re: About the new frame title
Date: Fri, 25 Sep 2020 14:38:44 +0200 (CEST)

> Il 24/09/2020 16:46 Eli Zaretskii ha scritto:
> 
>  
> > From: Stefan Kangas
> > Date: Thu, 24 Sep 2020 01:57:38 -0700
> > Cc: 
> > 
> > +  const char *title;
> >    if (STRINGP (system_name))
> >      {
> > -      *nametail++ = '@';
> > -      lispstpcpy (nametail, system_name);
> > +      title = "GNU Emacs at ";
> > +      ptrdiff_t nbytes = sizeof (title);
> 
> Does this work?  AFAIK, 'sizeof (char *)' returns 8 on a 64-bit system
> and 4 on a 32-bit system, regardless of the length of the text string
> it points to.

I wonder if this can fix it:

ptrdiff_t nbytes = strlen(title)*sizeof (title[0]);

or better, given 'title' is a const hard coded,

ptrdiff_t nbytes = 13*sizeof (title[0]);


Just a reminiscence of the ancient use of C ...



reply via email to

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