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

Defensive Programming Squad

Name: Anonymous 2008-10-22 5:59

In this thread we pick up innocent programs and tank the shit out of them.

#include <stdio.h>
int main () {
  int n1, n2;
  printf("First integer:");
  scanf("%d", &n1);
  printf("Second integer:");
  scanf("%d", &n2);
  printf("Sum = %d\n", n1+n2);
  return 0;
}

Name: Anonymous 2008-10-24 1:34

POSIX says nothing about the maximum value of LINE_MAX; in fact all you're guaranteed is that it's going to be >= 2048.
well, there is this:
http://www.opengroup.org/onlinepubs/000095399/utilities/tail.html
Tails relative to the end of the file may be saved in an internal buffer, and thus may be limited in length. Such a buffer, if any, shall be no smaller than {LINE_MAX}*10 bytes.

so if tail uses an internal buffer for tails relative to the end of a file, LINE_MAX can't possibly be more than UINTPTR_MAX / 10.
is there any way to implement tail without using an internal buffer for tails relative to the end of a file?

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