Skip to content

Commit

Permalink
Used sizeof(), and aligned headers to be consistent 😄
Browse files Browse the repository at this point in the history
  • Loading branch information
adiultra committed Jun 4, 2016
1 parent 22d3344 commit 1e960f1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
1 change: 1 addition & 0 deletions export.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <fstream>
#include <iostream>
#include <cstring>

#include "fabric.h"

using namespace std;
Expand Down
11 changes: 6 additions & 5 deletions fabric.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#include "fabric.h"

#include <iostream>
#include <cstring>

#include "fabric.h"


using namespace std;

List::List(){
Expand All @@ -26,13 +27,13 @@ void List::enter(){
cin.getline(choice, sizeof(choice));

if (!(strcmp(choice, "yes")*strcmp(choice, "y"))) {
char tagTemp[220];
char tagTemp[20];

cout << "Enter the tag one at a time" << endl << "\'d\' when done " << endl;
cout << green << " +> " << normal;

while (1) {
cin.getline(tagTemp, 20);
cin.getline(tagTemp, sizeof(tagTemp));

if (strcmp(tagTemp, "d") != 0) {
addTag(tagTemp);
Expand Down Expand Up @@ -120,7 +121,7 @@ void List::tagIndexView() {
void List::append(){
char Content[200];
cout << "Enter the content of ToDo" << endl << green << " +> " << normal;
cin.getline(Content, 200);
cin.getline(Content, sizeof(Content));

strcpy(list[_listIndex].content, Content);

Expand Down
4 changes: 2 additions & 2 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ int confirm() {
// can be used as if( confirm() ) /// Improves yes/no prompts
char confm[10];
cout << "Enter \'yes\' to continue" << endl << Bred << " ?> " << normal;
cin.getline(confm, 10);
cin.getline(confm, sizeof(confm));

if (!(strcmp(confm, "yes") * strcmp(confm, "y"))) {
return 1;
Expand Down Expand Up @@ -452,7 +452,7 @@ int main() {

while (1) {
cout << yellow << "\n *> " << normal;
cin.getline(command, 80);
cin.getline(command, sizeof(command));
int result = parse(command);

if(result > 0)
Expand Down
4 changes: 2 additions & 2 deletions search.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "fabric.h"

#include <iostream>
#include <cstring>

#include "fabric.h"

using namespace std;

// TODO
Expand Down

0 comments on commit 1e960f1

Please sign in to comment.