jot.c (34785a9fc0994307b052f9527df2653be9cf8b67) | jot.c (f88b45d7df9ba19dd72e7521853593ecf2d16073) |
---|---|
1/*- 2 * Copyright (c) 1993 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 --- 466 unchanged lines hidden (view full) --- 475 /* NOTREACHED */ 476 } 477 while (*++p) 478 if (*p == '%' && *(p+1) && *(p+1) != '%') 479 errx(1, "too many conversions"); 480 else if (*p == '%' && *(p+1) == '%') 481 p++; 482 else if (*p == '%' && !*(p+1)) { | 1/*- 2 * Copyright (c) 1993 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 --- 466 unchanged lines hidden (view full) --- 475 /* NOTREACHED */ 476 } 477 while (*++p) 478 if (*p == '%' && *(p+1) && *(p+1) != '%') 479 errx(1, "too many conversions"); 480 else if (*p == '%' && *(p+1) == '%') 481 p++; 482 else if (*p == '%' && !*(p+1)) { |
483 strcat(format, "%"); | 483 if (strlcat(format, "%", sizeof(format)) >= 484 sizeof(format)) 485 errx(1, "-w word too long"); |
484 break; 485 } 486 } 487} | 486 break; 487 } 488 } 489} |