- static char scratch[MAX_MARK_SIZE] = { '\0' };
- int rc, max_size = MAX_MARK_SIZE-1;
- struct libcfs_ioctl_data data = { 0 };
- char *text;
- time_t now = time(NULL);
-
- if (argc > 1) {
- int count;
- text = scratch;
- strncpy(text, argv[1], max_size);
- max_size-=strlen(argv[1]);
- for (count = 2; (count < argc) && (max_size > 0); count++){
- strncat(text, " ", max_size);
- max_size -= 1;
- strncat(text, argv[count], max_size);
- max_size -= strlen(argv[count]);
- }
- } else {
- text = ctime(&now);
- }
+ static char scratch[MAX_MARK_SIZE] = "";
+ struct libcfs_ioctl_data data = { 0 };
+ char *text;
+ int rc;
+
+ if (argc > 1) {
+ int count, max_size = sizeof(scratch) - 1;
+
+ strncpy(scratch, argv[1], max_size);
+ max_size -= strlen(argv[1]);
+ for (count = 2; (count < argc) && (max_size > 1); count++) {
+ strncat(scratch, " ", max_size);
+ max_size -= 1;
+ strncat(scratch, argv[count], max_size);
+ max_size -= strlen(argv[count]);
+ }
+ scratch[sizeof(scratch) - 1] = '\0';
+ text = scratch;
+ } else {
+ time_t now = time(NULL);
+ text = ctime(&now);
+ }