Actually read digits value
This commit is contained in:
parent
d7cc8d67e6
commit
6eccf2f2ea
@ -2,6 +2,7 @@ package main
|
||||
|
||||
/*
|
||||
#include <stdlib.h>
|
||||
#include <ncurses.h>
|
||||
*/
|
||||
import "C"
|
||||
import "unsafe"
|
||||
@ -22,3 +23,7 @@ func freeCStringArray(cStrings **C.char, length int) {
|
||||
C.free(unsafe.Pointer(s))
|
||||
}
|
||||
}
|
||||
|
||||
func debug(message string) {
|
||||
C.Debug(message)
|
||||
}
|
||||
|
13
go/totp.go
13
go/totp.go
@ -106,6 +106,17 @@ func loadConfigs() {
|
||||
}
|
||||
counter = cNum
|
||||
}
|
||||
case "digits":
|
||||
{
|
||||
dNum, err := strconv.Atoi(kv[1])
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
if dNum < 1 || dNum > 10 {
|
||||
log.Fatal("Digits is not in range 1-10")
|
||||
}
|
||||
digits = dNum
|
||||
}
|
||||
case "format":
|
||||
{
|
||||
} //TODO implement
|
||||
@ -121,7 +132,7 @@ func loadConfigs() {
|
||||
}
|
||||
err = config.ParseKey(key)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
fileName := fileEntry.Name()
|
||||
|
Loading…
Reference in New Issue
Block a user