On Wed, 8 Aug 2012, Pavel Vasilyev wrote:
> >>> Yes. So if s contains "abcde" then
> >>>
> >>> memcmp(s, "abc", 3) and strncmp(s, "abc", 3) will both return 0, and
> >>> memcmp(s, "abc", 4) and strncmp(s, "abc", 4) will both return 1.
> >>
> >> No matter what is contained in *s, "abcde" or "a
zeof(string);
Learned something.
Thanks,
Dan
> -Original Message-
> From: Bernd Petrovitsch [mailto:be...@petrovitsch.priv.at]
> Sent: Tuesday, August 07, 2012 6:20 AM
> To: Daniel Taylor
> Cc: 'Alan Stern'; Pavel Vasilyev; Pavel Machek; Len Brown;
> li
07.08.2012 21:24, Alan Stern пишет:
On Tue, 7 Aug 2012, Pavel Vasilyev wrote:
06.08.2012 23:59, Alan Stern пишет:
On Mon, 6 Aug 2012, Pavel Vasilyev wrote:
http://www.gossamer-threads.com/lists/engine?do=post_attachment;postatt_id=41157;list=linux
Interestingly, many (all?) of the changes
On Tue, 7 Aug 2012, Pavel Vasilyev wrote:
> 06.08.2012 23:59, Alan Stern пишет:
> > On Mon, 6 Aug 2012, Pavel Vasilyev wrote:
> >
> http://www.gossamer-threads.com/lists/engine?do=post_attachment;postatt_id=41157;list=linux
> >>>
> >>> Interestingly, many (all?) of the changes in that patch a
On Mon, 2012-08-06 at 22:57 +, Daniel Taylor wrote:
> Silly question: when did sizeof("string") get changed to be anything
> other than the size of the pointer ("string" is, after all, an array
> of characters)?
It is since K&R times that way.
If you do not know the difference between a poin
06.08.2012 23:59, Alan Stern пишет:
On Mon, 6 Aug 2012, Pavel Vasilyev wrote:
http://www.gossamer-threads.com/lists/engine?do=post_attachment;postatt_id=41157;list=linux
Interestingly, many (all?) of the changes in that patch are wrong
because they don't try to match the terminating '\0'. As
kernel.org] On Behalf Of Alan Stern
> Sent: Monday, August 06, 2012 1:00 PM
> To: Pavel Vasilyev
> Cc: Pavel Machek; Len Brown; linux-a...@vger.kernel.org;
> linux...@lists.linux-foundation.org;
> linux-kernel@vger.kernel.org; Len Brown
> Subject: Re: [linux-pm] [PATCH] ACPI: repla
On Mon, 6 Aug 2012, Pavel Vasilyev wrote:
> >> http://www.gossamer-threads.com/lists/engine?do=post_attachment;postatt_id=41157;list=linux
> >
> > Interestingly, many (all?) of the changes in that patch are wrong
> > because they don't try to match the terminating '\0'. As a result,
> > they will
06.08.2012 20:28, Alan Stern пишет:
On Mon, 6 Aug 2012, Pavel Vasilyev wrote:
06.08.2012 18:36, Alan Stern пишет:
On Mon, 6 Aug 2012, Pavel Machek wrote:
On Thu 2012-07-26 21:39:38, Len Brown wrote:
...both give the number of chars in the string
without the '\0', as strncmp() wants,
but siz
On Mon, 6 Aug 2012, Pavel Vasilyev wrote:
> 06.08.2012 18:36, Alan Stern пишет:
> > On Mon, 6 Aug 2012, Pavel Machek wrote:
> >
> >> On Thu 2012-07-26 21:39:38, Len Brown wrote:
> >>> ...both give the number of chars in the string
> >>> without the '\0', as strncmp() wants,
> >>> but sizeof() is c
06.08.2012 18:36, Alan Stern пишет:
On Mon, 6 Aug 2012, Pavel Machek wrote:
On Thu 2012-07-26 21:39:38, Len Brown wrote:
...both give the number of chars in the string
without the '\0', as strncmp() wants,
but sizeof() is compile-time.
What about introducing something like streq() to do this
On Mon, 6 Aug 2012, Pavel Machek wrote:
> On Thu 2012-07-26 21:39:38, Len Brown wrote:
> > ...both give the number of chars in the string
> > without the '\0', as strncmp() wants,
> > but sizeof() is compile-time.
>
> What about introducing something like streq() to do this
> automatically? This
On Thu 2012-07-26 21:39:38, Len Brown wrote:
> ...both give the number of chars in the string
> without the '\0', as strncmp() wants,
> but sizeof() is compile-time.
What about introducing something like streq() to do this
automatically? This is ugly
#define streq(a, b) ... if (_buildin_const
13 matches
Mail list logo