cleanups; full parenthesis for case ... esac statements
[util-vserver.git] / util-vserver / src / vlimit.c
index 3aba2b7..dc86ae0 100644 (file)
@@ -253,7 +253,7 @@ readFile(char const *file, char *base, char const *suffix,
 {
   int          fd;
   
-  memcpy(base, suffix, strlen(suffix)+1);
+  strcpy(base, suffix);
   fd = open(file, O_RDONLY);
   if (fd!=-1) {
     *limit = readValue(fd, file);
@@ -336,7 +336,7 @@ int main (int argc, char *argv[])
   }
   
   while (1) {
-    int                c = getopt_long(argc, argv, "MSHndhvac:", CMDLINE_OPTIONS, 0);
+    int                c = getopt_long(argc, argv, "+MSHndhvac:", CMDLINE_OPTIONS, 0);
     if (c==-1) break;
 
     if (2048<=c && c<2048+32) {
@@ -391,7 +391,9 @@ int main (int argc, char *argv[])
   if (ctx==VC_NOCTX)
     ctx = Evc_get_task_xid(0);
 
-  readFromDir(limits, &lim_mask, dir, missing_ok);
+  if (dir)
+    readFromDir(limits, &lim_mask, dir, missing_ok);
+
   setLimits(ctx, limits, lim_mask);
   if (show_all) showAll(ctx);