Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

char buf[LINE_MAX]

Name: Anonymous 2008-08-26 6:39

Why do programmers still code in arbitrary limits like these?

It breaks when you do
#define LINE_MAX UINT_MAX

Why not redesign so that you use an O(1) space algorithm, or if it can't be avoided, dynamically allocate as much as needed?

Name: Anonymous 2008-08-26 23:50

>>31
What. Dick lips.

Suppose you are parsing an incoming message, for example, the following message comes into your socket:


1 512 1024 I am humping a goat. The Sussman is humping a goat.


And you have a buffer of size 16, you read in the first 16 characters, so your buffer is filled with this:


1 512 1024 I am


How do you plan to save the state so that the full message can be read and understood after the whole thing has been read and processed?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List