- /* Okay, using "/" as swap device would be super-weird, but
- * we'll handle it anyway to cover all cases. */
- if (strcmp ("/", s->swt_ent[i].ste_path) == 0)
- sstrncpy (path, "root", sizeof (path));
- else
- {
- int j;
-
- s->swt_ent[i].ste_path[PATH_MAX - 1] = 0;
- /* Don't copy the leading slash */
- sstrncpy (path, &s->swt_ent[i].ste_path[1], sizeof (path));
- /* Convert slashes to dashes, just like the "df" plugin. */
- for (j = 0; path[j] != 0; j++)
- if (path[j] == '/')
- path[j] = '-';
- }
+ sstrncpy (path, s->swt_ent[i].ste_path, sizeof (path));
+ escape_slashes (path, sizeof (path));