patch-2.4.3 linux/drivers/isdn/avmb1/capifs.c

Next file: linux/drivers/isdn/avmb1/capiutil.c
Previous file: linux/drivers/isdn/avmb1/capidrv.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.2/linux/drivers/isdn/avmb1/capifs.c linux/drivers/isdn/avmb1/capifs.c
@@ -1,11 +1,23 @@
 /*
- * $Id: capifs.c,v 1.14.6.1 2000/11/28 12:02:45 kai Exp $
+ * $Id: capifs.c,v 1.14.6.5 2001/03/21 08:52:21 kai Exp $
  * 
  * (c) Copyright 2000 by Carsten Paeth (calle@calle.de)
  *
  * Heavily based on devpts filesystem from H. Peter Anvin
  * 
  * $Log: capifs.c,v $
+ * Revision 1.14.6.5  2001/03/21 08:52:21  kai
+ * merge from main branch: fix buffer for revision string (calle)
+ *
+ * Revision 1.14.6.4  2001/03/15 15:11:24  kai
+ * *** empty log message ***
+ *
+ * Revision 1.14.6.3  2001/02/13 11:43:29  kai
+ * more compatility changes for 2.2.19
+ *
+ * Revision 1.14.6.2  2001/02/10 14:41:20  kai
+ * Changes from kernel tree
+ *
  * Revision 1.14.6.1  2000/11/28 12:02:45  kai
  * MODULE_DEVICE_TABLE for 2.4
  *
@@ -93,7 +105,7 @@
 
 MODULE_AUTHOR("Carsten Paeth <calle@calle.de>");
 
-static char *revision = "$Revision: 1.14.6.1 $";
+static char *revision = "$Revision: 1.14.6.5 $";
 
 struct capifs_ncci {
 	struct inode *inode;
@@ -581,16 +593,17 @@
 
 static int __init capifs_init(void)
 {
-	char rev[10];
+	char rev[32];
 	char *p;
 	int err;
 
 	MOD_INC_USE_COUNT;
 
-	if ((p = strchr(revision, ':'))) {
-		strcpy(rev, p + 1);
-		p = strchr(rev, '$');
-		*p = 0;
+	if ((p = strchr(revision, ':')) != 0 && p[1]) {
+		strncpy(rev, p + 2, sizeof(rev));
+		rev[sizeof(rev)-1] = 0;
+		if ((p = strchr(rev, '$')) != 0 && p > rev)
+		   *(p-1) = 0;
 	} else
 		strcpy(rev, "1.0");
 
@@ -600,9 +613,9 @@
 		return err;
 	}
 #ifdef MODULE
-        printk(KERN_NOTICE "capifs: Rev%s: loaded\n", rev);
+        printk(KERN_NOTICE "capifs: Rev %s: loaded\n", rev);
 #else
-	printk(KERN_NOTICE "capifs: Rev%s: started\n", rev);
+	printk(KERN_NOTICE "capifs: Rev %s: started\n", rev);
 #endif
 	MOD_DEC_USE_COUNT;
 	return 0;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)