diff --git a/20160425/chardev-1write.c b/20160425/chardev-1write.c index 12cf5bb5fbd6cac4d64c6ef5f584c6e78c657cef..9cd2373eb1c46a06ebf34dd6440634ad16ff24d5 100644 --- a/20160425/chardev-1write.c +++ b/20160425/chardev-1write.c @@ -193,11 +193,11 @@ device_write(struct file *filp, const char *buff, size_t len, loff_t * off) else { int i; for(i = 0; i < len; i++) //Save the given string - msg_username[i] = buff[i]; + msg_username[i] = buff[i]; //Heres the CRASH for(i = len; i < USERBUF_LEN; i++) //Zeroing the rest of mem msg_username[i] = 0; - //printk(KERN_INFO "%s: Successfully got %d bytes!\n", - // DEVICE_NAME, (int)len); + printk(KERN_INFO "%s: Successfully got %d bytes!\n", + DEVICE_NAME, (int)len); if(msg_username[len-1] == '\n') //Got new line terminator ? msg_username[len-1] = 0; //Then terminate it! return len; //Emit successfully stored len bytes