Mercurial > cgi-bin > hgweb.cgi > PassMan
diff src/main/kotlin/name/blackcap/passman/Database.kt @ 5:ad997df1f560
Fix see() to be about as good as sccc.
author | David Barts <n5jrn@me.com> |
---|---|
date | Sun, 11 Sep 2022 21:29:20 -0700 |
parents | eafa3779aef8 |
children | 711cc42e96d7 |
line wrap: on
line diff
--- a/src/main/kotlin/name/blackcap/passman/Database.kt Sun Sep 11 20:44:59 2022 -0700 +++ b/src/main/kotlin/name/blackcap/passman/Database.kt Sun Sep 11 21:29:20 2022 -0700 @@ -18,9 +18,9 @@ val exists = Files.exists(Path.of(fileName)) if (!exists) { if (create) { - error("initializing database ${see(fileName, simple = true)}") + error("initializing database ${see(fileName)}") } else { - die("${see(fileName, simple = true)} not found") + die("${see(fileName)} not found") } } val masterPassword = getPassword(passwordPrompt, !exists) @@ -120,11 +120,6 @@ public fun ResultSet.getDecrypted(columnIndex: Int, encryption: Encryption) = encryption.decrypt(getBytes(columnIndex)) -public fun ResultSet.getDate(columnIndex: Int): java.util.Date? { - val rawDate = getLong(columnIndex) - return if (wasNull()) { null } else { java.util.Date(rawDate) } -} - public fun PreparedStatement.setEncryptedString(columnIndex: Int, value: String, encryption: Encryption) = setBytes(columnIndex, encryption.encryptFromString(value))