recvjob.c (119192) | recvjob.c (167260) |
---|---|
1/* 2 * Copyright (c) 1983, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 31 unchanged lines hidden (view full) --- 40 41#if 0 42#ifndef lint 43static char sccsid[] = "@(#)recvjob.c 8.2 (Berkeley) 4/27/95"; 44#endif /* not lint */ 45#endif 46 47#include "lp.cdefs.h" /* A cross-platform version of <sys/cdefs.h> */ | 1/* 2 * Copyright (c) 1983, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 31 unchanged lines hidden (view full) --- 40 41#if 0 42#ifndef lint 43static char sccsid[] = "@(#)recvjob.c 8.2 (Berkeley) 4/27/95"; 44#endif /* not lint */ 45#endif 46 47#include "lp.cdefs.h" /* A cross-platform version of <sys/cdefs.h> */ |
48__FBSDID("$FreeBSD: head/usr.sbin/lpr/lpd/recvjob.c 119192 2003-08-21 03:43:48Z gad $"); | 48__FBSDID("$FreeBSD: head/usr.sbin/lpr/lpd/recvjob.c 167260 2007-03-06 09:32:41Z kevlo $"); |
49 50/* 51 * Receive printer jobs from the network, queue them and 52 * start the printer daemon. 53 */ 54#include <sys/param.h> 55#include <sys/mount.h> 56#include <sys/stat.h> --- 289 unchanged lines hidden (view full) --- 346static int 347read_number(const char *fn) 348{ 349 char lin[80]; 350 register FILE *fp; 351 352 if ((fp = fopen(fn, "r")) == NULL) 353 return (0); | 49 50/* 51 * Receive printer jobs from the network, queue them and 52 * start the printer daemon. 53 */ 54#include <sys/param.h> 55#include <sys/mount.h> 56#include <sys/stat.h> --- 289 unchanged lines hidden (view full) --- 346static int 347read_number(const char *fn) 348{ 349 char lin[80]; 350 register FILE *fp; 351 352 if ((fp = fopen(fn, "r")) == NULL) 353 return (0); |
354 if (fgets(lin, 80, fp) == NULL) { | 354 if (fgets(lin, sizeof(lin), fp) == NULL) { |
355 fclose(fp); 356 return (0); 357 } 358 fclose(fp); 359 return (atoi(lin)); 360} 361 362/* --- 47 unchanged lines hidden --- | 355 fclose(fp); 356 return (0); 357 } 358 fclose(fp); 359 return (atoi(lin)); 360} 361 362/* --- 47 unchanged lines hidden --- |