Re: What's wrong with this RC4?



Sebastian Gottschalk <seppi@xxxxxxxxx> writes:
> Andrew Pogrebennyk wrote:
>
> > for (counter = 0; counter < strlen(buffer); counter++);
>
> > I'm compiling it with GCC 3.3.5 on on Debian GNU/Linux... Could anybody
> > point me what's wrong here?
>
> strlen(char[]) is undefined and most-likely zero, so your loop doesn't even
> run. Try using strlen(&buffer) respective strlen(&key) instead.

Firstly, your initial comment is just plain wrong.
Secondly, your suggestion is just plain wronger!

A char[] decays into a pointer to its first element in such situations.
If you explicitly want a pointer to its first element then &buffer[0]
should be used.

Phil
--
What is it: is man only a blunder of God, or God only a blunder of man?
-- Friedrich Nietzsche (1844-1900), The Twilight of the Gods
.



Relevant Pages

  • Re: 21st Century repeat of ~ Sodom & Gomorrah ~
    ... I am being a mediator between plain ... But God STILL commended the prophets for their work, ... the rest scorned Noah's preaching and suffered the ...
    (uk.religion.christian)
  • Re: Seo , Search Engine Optimizer , Seo Search engine Optimization , search engine optimization serv
    ... those things that looked so plain to them, and, by all they can do, they ... till God renews the influence of His Spirit. ... woman, of about seventy years, who had spent most of her days under Mr. ... Christ's sufferings for sinners, she seemed to be astonished at what she ...
    (rec.arts.books.tolkien)
  • Re: Can Christian Electronic Designers Design?
    ... If something in the bible is immoral,unjust, unethical or just plain ... nuts then it's meant to be taken figuratively. ... God said to Adam/Eve that they would die if the ate the fruit. ... Christian engineers are ridiculous to force nonsense in the bible to ...
    (sci.electronics.design)
  • Re: Can Christian Electronic Designers Design?
    ... If something in the bible is immoral,unjust, unethical or just plain ... God said to Adam/Eve that they would die if the ate the fruit. ... 'You must not eat it or even ... There is no book sanctioned by 38000 Christian denominations as to being ...
    (sci.electronics.design)
  • Re: Is there an accurately translated Bible? No, the premise is false
    ... > and consistent message to us, ... 1:19 because what can be known about God is ... plain to them; because God has made it plain to them." ... Matthew Johnson but God, as You know, if I were to believe everyone who ...
    (soc.religion.christian)