changeset 45:f263adbf7445

merge
author David A. Holland
date Sat, 30 Mar 2013 22:33:53 -0400
parents ad7763329eba (current diff) 57e0c7a50b2d (diff)
children eaa154ded584
files
diffstat 2 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/main.c	Sat Mar 30 22:29:42 2013 -0400
+++ b/main.c	Sat Mar 30 22:33:53 2013 -0400
@@ -504,7 +504,7 @@
 ////////////////////////////////////////////////////////////
 // complex modes
 
-static
+__dead static
 void
 commandline_iremap(const struct place *p, char *str)
 {
@@ -824,14 +824,14 @@
 bool
 check_prefix_option(const struct place *p, char *opt)
 {
-	unsigned i;
+	unsigned i, len;
 	int r;
 
 	for (i=0; i<num_prefix_options; i++) {
-		r = strncmp(opt, prefix_options[i].string,
-			    strlen(prefix_options[i].string));
+		len = strlen(prefix_options[i].string);
+		r = strncmp(opt, prefix_options[i].string, len);
 		if (r == 0) {
-			prefix_options[i].func(p, opt);
+			prefix_options[i].func(p, opt + len);
 			return true;
 		}
 		if (r < 0) {
@@ -865,7 +865,7 @@
 	return false;
 }
 
-static
+__dead static
 void
 usage(void)
 {
--- a/utils.h	Sat Mar 30 22:29:42 2013 -0400
+++ b/utils.h	Sat Mar 30 22:33:53 2013 -0400
@@ -53,10 +53,10 @@
 bool is_identifier(const char *str);
 
 /* in place.c */
-void complain(const struct place *, const char *fmt, ...);
+void complain(const struct place *, const char *fmt, ...) __printflike(2, 3);
 void complain_fail(void);
 bool complain_failed(void);
 
 /* in main.c */
 void freestringlater(char *s);
-void die(void);
+__dead void die(void);