diff -ru fbsd-indent.orig/args.c fbsd-indent/args.c
--- fbsd-indent.orig/args.c	2017-03-21 20:39:33.000000000 -0400
+++ fbsd-indent/args.c	2024-12-22 18:48:40.616631848 -0500
@@ -40,7 +40,9 @@
 #endif
 
 #include <sys/cdefs.h>
+#if 0
 __FBSDID("$FreeBSD$");
+#endif
 
 /*
  * Argument scanning and profile reading code.  Default parameters are set
diff -ru fbsd-indent.orig/indent.c fbsd-indent/indent.c
--- fbsd-indent.orig/indent.c	2017-03-21 20:39:30.000000000 -0400
+++ fbsd-indent/indent.c	2025-04-01 12:14:18.846709910 -0400
@@ -41,6 +41,8 @@
 	The Regents of the University of California.  All rights reserved.\n";
 #endif /* not lint */
 
+#define nitems(x) (sizeof(x)/sizeof(*(x)))
+
 #if 0
 #ifndef lint
 static char sccsid[] = "@(#)indent.c	5.17 (Berkeley) 6/7/93";
@@ -48,10 +50,14 @@
 #endif
 
 #include <sys/cdefs.h>
+#if 0
 __FBSDID("$FreeBSD$");
+#endif
 
 #include <sys/param.h>
+#if 0
 #include <sys/capsicum.h>
+#endif
 #include <err.h>
 #include <errno.h>
 #include <fcntl.h>
@@ -60,6 +66,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
+#define EXTERN  /* deliberately empty */
 #include "indent_globs.h"
 #include "indent_codes.h"
 #include "indent.h"
@@ -76,7 +83,9 @@
 int
 main(int argc, char **argv)
 {
+#if 0
     cap_rights_t rights;
+#endif
 
     int         dec_ind;	/* current indentation for declarations */
     int         di_stack[20];	/* a stack of structure indentation levels */
@@ -241,6 +250,7 @@
 	}
     }
 
+#if 0
     /* Restrict input/output descriptors and enter Capsicum sandbox. */
     cap_rights_init(&rights, CAP_FSTAT, CAP_WRITE);
     if (cap_rights_limit(fileno(output), &rights) < 0 && errno != ENOSYS)
@@ -250,6 +260,7 @@
 	err(EXIT_FAILURE, "unable to limit rights for %s", in_name);
     if (cap_enter() < 0 && errno != ENOSYS)
 	err(EXIT_FAILURE, "unable to enter capability mode");
+#endif
 
     if (ps.com_ind <= 1)
 	ps.com_ind = 2;		/* dont put normal comments before column 2 */
diff -ru fbsd-indent.orig/indent_globs.h fbsd-indent/indent_globs.h
--- fbsd-indent.orig/indent_globs.h	2017-03-21 20:39:30.000000000 -0400
+++ fbsd-indent/indent_globs.h	2025-04-01 12:15:21.718211809 -0400
@@ -50,9 +50,13 @@
 #define false 0
 #define true  1
 
+#ifndef EXTERN
+#define EXTERN extern
+#endif
 
-FILE       *input;		/* the fid for the input file */
-FILE       *output;		/* the output file */
+
+EXTERN FILE       *input;		/* the fid for the input file */
+EXTERN FILE       *output;		/* the output file */
 
 #define CHECK_SIZE_CODE \
 	if (e_code >= l_code) { \
@@ -101,92 +105,92 @@
 	    s_token = tokenbuf + 1; \
 	}
 
-char       *labbuf;		/* buffer for label */
-char       *s_lab;		/* start ... */
-char       *e_lab;		/* .. and end of stored label */
-char       *l_lab;		/* limit of label buffer */
-
-char       *codebuf;		/* buffer for code section */
-char       *s_code;		/* start ... */
-char       *e_code;		/* .. and end of stored code */
-char       *l_code;		/* limit of code section */
-
-char       *combuf;		/* buffer for comments */
-char       *s_com;		/* start ... */
-char       *e_com;		/* ... and end of stored comments */
-char       *l_com;		/* limit of comment buffer */
+EXTERN char       *labbuf;		/* buffer for label */
+EXTERN char       *s_lab;		/* start ... */
+EXTERN char       *e_lab;		/* .. and end of stored label */
+EXTERN char       *l_lab;		/* limit of label buffer */
+
+EXTERN char       *codebuf;		/* buffer for code section */
+EXTERN char       *s_code;		/* start ... */
+EXTERN char       *e_code;		/* .. and end of stored code */
+EXTERN char       *l_code;		/* limit of code section */
+
+EXTERN char       *combuf;		/* buffer for comments */
+EXTERN char       *s_com;		/* start ... */
+EXTERN char       *e_com;		/* ... and end of stored comments */
+EXTERN char       *l_com;		/* limit of comment buffer */
 
 #define token s_token
-char       *tokenbuf;		/* the last token scanned */
-char	   *s_token;
-char       *e_token;
-char	   *l_token;
-
-char       *in_buffer;		/* input buffer */
-char	   *in_buffer_limit;	/* the end of the input buffer */
-char       *buf_ptr;		/* ptr to next character to be taken from
+EXTERN char       *tokenbuf;		/* the last token scanned */
+EXTERN char	   *s_token;
+EXTERN char       *e_token;
+EXTERN char	   *l_token;
+
+EXTERN char       *in_buffer;		/* input buffer */
+EXTERN char	   *in_buffer_limit;	/* the end of the input buffer */
+EXTERN char       *buf_ptr;		/* ptr to next character to be taken from
 				 * in_buffer */
-char       *buf_end;		/* ptr to first after last char in in_buffer */
+EXTERN char       *buf_end;		/* ptr to first after last char in in_buffer */
 
-char        save_com[sc_size];	/* input text is saved here when looking for
+EXTERN char        save_com[sc_size];	/* input text is saved here when looking for
 				 * the brace after an if, while, etc */
-char       *sc_end;		/* pointer into save_com buffer */
+EXTERN char       *sc_end;		/* pointer into save_com buffer */
 
-char       *bp_save;		/* saved value of buf_ptr when taking input
+EXTERN char       *bp_save;		/* saved value of buf_ptr when taking input
 				 * from save_com */
-char       *be_save;		/* similarly saved value of buf_end */
+EXTERN char       *be_save;		/* similarly saved value of buf_end */
 
 
-int         found_err;
-int         pointer_as_binop;
-int         blanklines_after_declarations;
-int         blanklines_before_blockcomments;
-int         blanklines_after_procs;
-int         blanklines_around_conditional_compilation;
-int         swallow_optional_blanklines;
-int         n_real_blanklines;
-int         prefix_blankline_requested;
-int         postfix_blankline_requested;
-int         break_comma;	/* when true and not in parens, break after a
+EXTERN int         found_err;
+EXTERN int         pointer_as_binop;
+EXTERN int         blanklines_after_declarations;
+EXTERN int         blanklines_before_blockcomments;
+EXTERN int         blanklines_after_procs;
+EXTERN int         blanklines_around_conditional_compilation;
+EXTERN int         swallow_optional_blanklines;
+EXTERN int         n_real_blanklines;
+EXTERN int         prefix_blankline_requested;
+EXTERN int         postfix_blankline_requested;
+EXTERN int         break_comma;	/* when true and not in parens, break after a
 				 * comma */
-int         btype_2;		/* when true, brace should be on same line as
+EXTERN int         btype_2;		/* when true, brace should be on same line as
 				 * if, while, etc */
-float       case_ind;		/* indentation level to be used for a "case
+EXTERN float       case_ind;		/* indentation level to be used for a "case
 				 * n:" */
-int         code_lines;		/* count of lines with code */
-int         had_eof;		/* set to true when input is exhausted */
-int         line_no;		/* the current line number. */
-int         max_col;		/* the maximum allowable line length */
-int         verbose;		/* when true, non-essential error messages are
+EXTERN int         code_lines;		/* count of lines with code */
+EXTERN int         had_eof;		/* set to true when input is exhausted */
+EXTERN int         line_no;		/* the current line number. */
+EXTERN int         max_col;		/* the maximum allowable line length */
+EXTERN int         verbose;		/* when true, non-essential error messages are
 				 * printed */
-int         cuddle_else;	/* true if else should cuddle up to '}' */
-int         star_comment_cont;	/* true iff comment continuation lines should
+EXTERN int         cuddle_else;	/* true if else should cuddle up to '}' */
+EXTERN int         star_comment_cont;	/* true iff comment continuation lines should
 				 * have stars at the beginning of each line. */
-int         comment_delimiter_on_blankline;
-int         troff;		/* true iff were generating troff input */
-int         procnames_start_line;	/* if true, the names of procedures
+EXTERN int         comment_delimiter_on_blankline;
+EXTERN int         troff;		/* true iff were generating troff input */
+EXTERN int         procnames_start_line;	/* if true, the names of procedures
 					 * being defined get placed in column
 					 * 1 (ie. a newline is placed between
 					 * the type of the procedure and its
 					 * name) */
-int         proc_calls_space;	/* If true, procedure calls look like:
+EXTERN int         proc_calls_space;	/* If true, procedure calls look like:
 				 * foo(bar) rather than foo (bar) */
-int         format_block_comments;	/* true if comments beginning with
+EXTERN int         format_block_comments;	/* true if comments beginning with
 					 * `/ * \n' are to be reformatted */
-int         format_col1_comments;	/* If comments which start in column 1
+EXTERN int         format_col1_comments;	/* If comments which start in column 1
 					 * are to be magically reformatted
 					 * (just like comments that begin in
 					 * later columns) */
-int         inhibit_formatting;	/* true if INDENT OFF is in effect */
-int         suppress_blanklines;/* set iff following blanklines should be
+EXTERN int         inhibit_formatting;	/* true if INDENT OFF is in effect */
+EXTERN int         suppress_blanklines;/* set iff following blanklines should be
 				 * suppressed */
-int         continuation_indent;/* set to the indentation between the edge of
+EXTERN int         continuation_indent;/* set to the indentation between the edge of
 				 * code and continuation lines */
-int         lineup_to_parens;	/* if true, continued code within parens will
+EXTERN int         lineup_to_parens;	/* if true, continued code within parens will
 				 * be lined up to the open paren */
-int         Bill_Shannon;	/* true iff a blank should always be inserted
+EXTERN int         Bill_Shannon;	/* true iff a blank should always be inserted
 				 * after sizeof */
-int         blanklines_after_declarations_at_proctop;	/* This is vaguely
+EXTERN int         blanklines_after_declarations_at_proctop;	/* This is vaguely
 							 * similar to
 							 * blanklines_after_decla
 							 * rations except that
@@ -199,20 +203,20 @@
 							 * to be generated even
 							 * if there are no
 							 * declarations */
-int         block_comment_max_col;
-int         extra_expression_indent;	/* true if continuation lines from the
+EXTERN int         block_comment_max_col;
+EXTERN int         extra_expression_indent;	/* true if continuation lines from the
 					 * expression part of "if(e)",
 					 * "while(e)", "for(e;e;e)" should be
 					 * indented an extra tab stop so that
 					 * they don't conflict with the code
 					 * that follows */
-int	    function_brace_split;	/* split function declaration and
+EXTERN int	    function_brace_split;	/* split function declaration and
 					 * brace onto separate lines */
-int	    use_tabs;			/* set true to use tabs for spacing,
+EXTERN int	    use_tabs;			/* set true to use tabs for spacing,
 					 * false uses all spaces */
-int	    auto_typedefs;		/* set true to recognize identifiers
+EXTERN int	    auto_typedefs;		/* set true to recognize identifiers
 					 * ending in "_t" like typedefs */
-int	    space_after_cast;		/* "b = (int) a" vs "b = (int)a" */
+EXTERN int	    space_after_cast;		/* "b = (int) a" vs "b = (int)a" */
 
 /* -troff font state information */
 
@@ -220,10 +224,10 @@
     char        font[4];
     char        size;
     int         allcaps:1;
-} __aligned(sizeof(int));
-char       *chfont(struct fstate *, struct fstate *, char *);
+} /*__aligned(sizeof(int))*/;
+EXTERN char       *chfont(struct fstate *, struct fstate *, char *);
 
-struct fstate
+EXTERN struct fstate
             keywordf,		/* keyword font */
             stringf,		/* string font */
             boxcomf,		/* Box comment font */
@@ -234,7 +238,7 @@
 
 #define	STACKSIZE 256
 
-struct parser_state {
+EXTERN struct parser_state {
     int         last_token;
     struct fstate cfont;	/* Current font */
     int         p_stack[STACKSIZE];	/* this is the parsers stack */
@@ -329,7 +333,7 @@
     int         just_saw_decl;
 }           ps;
 
-int         ifdef_level;
-int	    rparen_count;
-struct parser_state state_stack[5];
-struct parser_state match_state[5];
+EXTERN int         ifdef_level;
+EXTERN int	    rparen_count;
+EXTERN struct parser_state state_stack[5];
+EXTERN struct parser_state match_state[5];
diff -ru fbsd-indent.orig/io.c fbsd-indent/io.c
--- fbsd-indent.orig/io.c	2017-03-21 20:39:33.000000000 -0400
+++ fbsd-indent/io.c	2024-12-22 18:48:40.640631648 -0500
@@ -40,7 +40,9 @@
 #endif
 
 #include <sys/cdefs.h>
+#if 0
 __FBSDID("$FreeBSD$");
+#endif
 
 #include <ctype.h>
 #include <err.h>
@@ -366,7 +368,7 @@
 		had_eof = true;
 		break;
 	}
-	*p++ = i;
+	*p++ = i > 0x7F ? 0x7F : i;
 	if (i == '\n')
 		break;
     }
diff -ru fbsd-indent.orig/lexi.c fbsd-indent/lexi.c
--- fbsd-indent.orig/lexi.c	2017-03-21 20:39:33.000000000 -0400
+++ fbsd-indent/lexi.c	2024-12-22 18:48:40.644631615 -0500
@@ -39,7 +39,9 @@
 #endif /* not lint */
 #endif
 #include <sys/cdefs.h>
+#if 0
 __FBSDID("$FreeBSD$");
+#endif
 
 /*
  * Here we have the token scanner for indent.  It scans off one token and puts
diff -ru fbsd-indent.orig/parse.c fbsd-indent/parse.c
--- fbsd-indent.orig/parse.c	2017-03-21 20:39:33.000000000 -0400
+++ fbsd-indent/parse.c	2024-12-22 18:48:40.648631581 -0500
@@ -40,7 +40,9 @@
 #endif
 
 #include <sys/cdefs.h>
+#if 0
 __FBSDID("$FreeBSD$");
+#endif
 
 #include <err.h>
 #include <stdio.h>
diff -ru fbsd-indent.orig/pr_comment.c fbsd-indent/pr_comment.c
--- fbsd-indent.orig/pr_comment.c	2017-03-21 20:39:33.000000000 -0400
+++ fbsd-indent/pr_comment.c	2024-12-22 18:48:40.652631548 -0500
@@ -40,7 +40,9 @@
 #endif
 
 #include <sys/cdefs.h>
+#if 0
 __FBSDID("$FreeBSD$");
+#endif
 
 #include <err.h>
 #include <stdio.h>
