Commit | Line | Data |
---|---|---|
ed3947dd | 1 | /* |
a6c6a0df RE |
2 | * Copyright (c) 1980 Regents of the University of California. |
3 | * All rights reserved. The Berkeley software License Agreement | |
4 | * specifies the terms and conditions for redistribution. | |
5 | * | |
6 | * @(#)s_rnge.c 5.1 %G% | |
ed3947dd DW |
7 | */ |
8 | ||
9 | #include <stdio.h> | |
10 | ||
11 | /* called when a subscript is out of range */ | |
12 | ||
13 | s_rnge(varn, offset, procn, line) | |
14 | char *varn, *procn; | |
15 | long int offset; | |
16 | int line; | |
17 | { | |
18 | register int i; | |
19 | ||
20 | fprintf(stderr, "Subscript out of range on file line %d, procedure ", line); | |
21 | for(i = 0 ; i < 8 && *procn!='_' ; ++i) | |
22 | putc(*procn++, stderr); | |
23 | fprintf(stderr, ".\nAttempt to access the %ld-th element of variable ", offset+1); | |
24 | for(i = 0 ; i < 6 && *varn!=' ' ; ++i) | |
25 | putc(*varn++, stderr); | |
26 | fprintf(stderr, ".\n"); | |
50fd198f | 27 | f77_abort(); |
ed3947dd | 28 | } |