ftp.nice.ch/pub/next/connectivity/infosystems/WAIStation.1.9.6.N.b.tar.gz#/WAIS/lib/trunc.c

This is trunc.c in view mode; [Download] [Up]

#include <stdio.h>

main(argc, argv)
int argc;
char **argv;
{
  int len, i, c;

  if (argc != 2) {
    fprintf(stderr, "Usage: %s length\n", argv[0]);
    exit(-1);
  }

  len = atoi(argv[1]);
  i = 0;
  while (EOF != (c = getchar())) {
    if (c == '\n') {
      putchar(c);
      fflush(stdout);
      i = 0;
    }
    else if (i++ < len)
      putchar(c);
  }
}

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.