Mark Hymers | 1 Jul 2003 01:12
Picon
Favicon

Re: YOU BASTARDS

On Sat, 28, Jun, 2003 at 05:46:00PM +0100, Ian Molton spoke thus..
> On Sat, 28 Jun 2003 14:44:03 +0000 (UTC)
> markh <at> linuxfromscratch.org (Mark Hymers) wrote:
> 
> > 
> > I was there all day on Tuesday and Wednesday - honest!
> 
> Did you see someone wandering about with a green dragon on their back?
> (backpack)

Not that I noticed, no.  Did you see a slightly <ahem> overweight person
wearing a grey T-Shirt and jeans.  Actually, that's probably not that
helpful.  I was at the LTSP talk / demonstration, the SuSE talk and
spent a lot of the rest of the time drinking coffee next to the .org
village.

Mark

-- 
Mark Hymers <markh at linuxfromscratch dot org>

"The older I grow, the more I distrust the familiar doctrine that age
 brings wisdom."
     H.L. Mencken
--

-- 
Unsubscribe: send email to listar <at> linuxfromscratch.org
and put 'unsubscribe lfs-chat' in the subject header of the message

Andy Bennett | 1 Jul 2003 01:24
Picon

Re: Strange C errors

Hi,

> You are never setting the token field of the newly allocated list
> element to the token passed as argument to the function. Seems strange
> to me?

Yeah.. That is what the /* for now */ comment was all about. I was trying to
get it to build an empty linked list of the correct number of elements
first.

> More importantly, you are never setting tOrigList to the passed tList,
> so when returning from the function the return value could be anything.

Yeah, I had noticed this and fixed it. Tho it does not matter yet because we
never succesfully get to the second element. - When we issue malloc for the
first element we suddenly loose our pointer that strtok was holding. - When
we return the first time we find the rest of our buffer empty. - That is the
main problem.

> A final note is that the algorithm is terribly inefficient. Every time
> you add a token you ahev to traverse the list to the end. As the list
> grows longer, this will take more and more time. If you insist on
> using a singly-linked list as DT, you could instead add the new
> elements to the front, and as a final step when all tokens have been
> added reverse the whole list. Then you'll only have to traverse the
> list one time.

Yeah... You are right. I was going to build it backward and then invert it
but I wanted it the correct way round. - I did not think about it too much
so did not realise that it is more efficient to build it first then invert
(Continue reading)

Björn Lindberg | 1 Jul 2003 01:31
Picon
Picon
Favicon

Re: Strange C errors

"Andy Bennett" <andyjpb <at> bigfoot.com> writes:

> Hi,
> 
> 
> > You are never setting the token field of the newly allocated list
> > element to the token passed as argument to the function. Seems strange
> > to me?
> 
> Yeah.. That is what the /* for now */ comment was all about. I was trying to
> get it to build an empty linked list of the correct number of elements
> first.
> 
> 
> > More importantly, you are never setting tOrigList to the passed tList,
> > so when returning from the function the return value could be anything.
> 
> Yeah, I had noticed this and fixed it. Tho it does not matter yet because we
> never succesfully get to the second element. - When we issue malloc for the
> first element we suddenly loose our pointer that strtok was holding. - When
> we return the first time we find the rest of our buffer empty. - That is the
> main problem.

Oh ok. If you post a complete code snippet (ie that compiles & runs)
that exhibits the error, I'll help you debug it.

Björn
--

-- 
Unsubscribe: send email to listar <at> linuxfromscratch.org
and put 'unsubscribe lfs-chat' in the subject header of the message
(Continue reading)

Andy Bennett | 1 Jul 2003 01:35
Picon

Re: Strange C errors

Hi,

Thanks for your help.

Sorry for replying to myself...

> > More importantly, you are never setting tOrigList to the passed tList,
> > so when returning from the function the return value could be anything.
>
> Yeah, I had noticed this and fixed it. Tho it does not matter yet because
we
> never succesfully get to the second element. - When we issue malloc for
the
> first element we suddenly loose our pointer that strtok was holding. -
When
> we return the first time we find the rest of our buffer empty. - That is
the
> main problem.

I switched to using strtok_r because it is thread safe and stores its state
variable somewhere I can see.

So,
for the input
  hello world
  this is a test

 for (tok = strtok_r(buf, "\r\n", &state); tok != NULL;
      tok = strtok_r(NULL, "\r\n", &state)) {
  printf("&&%s&&\n", tok);
(Continue reading)

Andy Bennett | 1 Jul 2003 01:38
Picon

Re: Strange C errors

Hi,

> Oh ok. If you post a complete code snippet (ie that compiles & runs)
> that exhibits the error, I'll help you debug it.

Oh Wow... Thanks.
Here is it. :-)

I have also attached the Makefile that I am using.

I invoke ./main and then type
Hello World
This is a test
CTRL+D

at it.

Thanks for your time.
(I can join IRC if that helps and then I will post a summary to the list)

Regards,
 <at> ndy

--
andyjpb <at> ashurst.eu.org
http://www.ashurst.eu.org/
0x7EBA75FF

begin 666 main.c
M+RH*("H <at> 4')O9W)A;2!T;R!R96%D('9#86P <at> ;V)J96-T<R!F<F]M('-T9&EN
(Continue reading)

Ian Molton | 1 Jul 2003 01:48

Re: Strange C errors

On Mon, 30 Jun 2003 16:20:13 +0100
"Andy Bennett" <andyjpb <at> bigfoot.com> wrote:

> 
> 
> I am trying to write a piece of code that read from stdin and places
> the characters in a buffer that grows dynamically.
> The code is attached.

cleartext or not at all please.

-- 
Spyros lair: http://www.mnementh.co.uk/   ||||   Maintainer: arm26 linux

Do not meddle in the affairs of Dragons, for you are tasty and good with
ketchup.
--

-- 
Unsubscribe: send email to listar <at> linuxfromscratch.org
and put 'unsubscribe lfs-chat' in the subject header of the message

Andy Bennett | 1 Jul 2003 01:55
Picon

Re: Strange C errors

Hi,

> cleartext or not at all please.

Say what?
I wrote it in vim....

Regards,
 <at> ndy

--
andyjpb <at> ashurst.eu.org
http://www.ashurst.eu.org/
0x7EBA75FF

--

-- 
Unsubscribe: send email to listar <at> linuxfromscratch.org
and put 'unsubscribe lfs-chat' in the subject header of the message

Ian Molton | 1 Jul 2003 01:54

Re: YOU BASTARDS

On Mon, 30 Jun 2003 23:10:10 +0000 (UTC)
markh <at> linuxfromscratch.org (Mark Hymers) wrote:

> > Did you see someone wandering about with a green dragon on their
> > back?(backpack)
> 
> Not that I noticed, no.

Ah, you're blind... now I know why you didnt see me :-)

> spent a lot of the rest of the time drinking coffee next to
> the .org village.

Damn! we probably stood next to each other. got a photo?

-- 
Spyros lair: http://www.mnementh.co.uk/   ||||   Maintainer: arm26 linux

Do not meddle in the affairs of Dragons, for you are tasty and good with
ketchup.
--

-- 
Unsubscribe: send email to listar <at> linuxfromscratch.org
and put 'unsubscribe lfs-chat' in the subject header of the message

Ian Molton | 1 Jul 2003 01:55

Re: what the hell?

On Mon, 30 Jun 2003 15:21:18 +0000 (UTC)
Remy.Bosch <at> hccnet.nl ("R. Bosch") wrote:

> >   you've got to quit telling those noobs to f*** off who don't read
> >   the manual. (this phrasing is bad too but I give up trying to fix
> >   it)
> 
> And I do remember you writing "peace of shit"....

LMAO. you guys are hillarious ;-)

-- 
Spyros lair: http://www.mnementh.co.uk/   ||||   Maintainer: arm26 linux

Do not meddle in the affairs of Dragons, for you are tasty and good with
ketchup.
--

-- 
Unsubscribe: send email to listar <at> linuxfromscratch.org
and put 'unsubscribe lfs-chat' in the subject header of the message

Ian Molton | 1 Jul 2003 01:56

Re: Intel Create and Share Camera Pack/Packard Bell

On Mon, 30 Jun 2003 22:42:06 +0100
"S. Anthony Sequeira" <tony <at> sequeira.com> wrote:

> 
> Have I any hope?  I have the Tech Specs, loads of docs and a CD and
> floppy(windows) drivers.

Chipset and/or USB ID?

-- 
Spyros lair: http://www.mnementh.co.uk/   ||||   Maintainer: arm26 linux

Do not meddle in the affairs of Dragons, for you are tasty and good with
ketchup.
--

-- 
Unsubscribe: send email to listar <at> linuxfromscratch.org
and put 'unsubscribe lfs-chat' in the subject header of the message


Gmane