pr_time.c (70498d5a53b47bb1d5e8f89537dfb5280b467328) | pr_time.c (6d7977a7cc789ad51b6dc37538e7a68612352465) |
---|---|
1/*- 2 * Copyright (c) 1990, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 62 unchanged lines hidden (view full) --- 71 (void)strcpy(fmt, __CONCAT("%a%", "I%p")); 72 } 73 74 /* Default is hh:mm{am,pm}. */ 75 else { 76 (void)strcpy(fmt, __CONCAT("%l:%", "M%p")); 77 } 78 | 1/*- 2 * Copyright (c) 1990, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 62 unchanged lines hidden (view full) --- 71 (void)strcpy(fmt, __CONCAT("%a%", "I%p")); 72 } 73 74 /* Default is hh:mm{am,pm}. */ 75 else { 76 (void)strcpy(fmt, __CONCAT("%l:%", "M%p")); 77 } 78 |
79 (void)strftime(buf, sizeof(buf), fmt, tp); | 79 (void)strftime(buf, sizeof(buf) - 1, fmt, tp); 80 buf[sizeof(buf) - 1] = '\0'; |
80 (void)printf("%s", buf); 81} 82 83/* 84 * pr_idle -- 85 * Display the idle time. 86 */ 87int --- 25 unchanged lines hidden --- | 81 (void)printf("%s", buf); 82} 83 84/* 85 * pr_idle -- 86 * Display the idle time. 87 */ 88int --- 25 unchanged lines hidden --- |